You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Why are generics not deducing nested objects correctly? #57658
Indexed accesses like this are never used as inference sources - the information at this location is at best partial information for what T can be. That said, there is an open PR that would make this inference work: #53017
You can just infer into the whole T like this: TS playground
Or you can rewrite this signature using reverse-mapped types: TS playground
Using the technique above you can even benefit from excess property check in the upcoming TS 5.4: TS playground
Activity
Andarist commentedon Mar 6, 2024
Indexed accesses like this are never used as inference sources - the information at this location is at best partial information for what
Tcan be. That said, there is an open PR that would make this inference work: #53017You can just infer into the whole
Tlike this: TS playgroundOr you can rewrite this signature using reverse-mapped types: TS playground
Using the technique above you can even benefit from excess property check in the upcoming TS 5.4: TS playground
masterYi2333 commentedon Mar 8, 2024
thanks