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
Broken type inference for union of function and objectΒ #59573
Typescript cannot infer/passthrough the type parameter in ComponentAugment
π Expected behavior
It should resolve ComponentAugment the same way it does with ComponentPassthrough, but with the added id property in this case. The expected type of b in this example should be:
Essentially a duplicate of #49505. TS has quite limited support for higher order function type inference; it's implemented at #30215 and mentions the very specific circumstances in which you can expect it to work. As soon as you do something like add that intersection, it stops working.
Activity
jcalz commentedon Aug 9, 2024
Essentially a duplicate of #49505. TS has quite limited support for higher order function type inference; it's implemented at #30215 and mentions the very specific circumstances in which you can expect it to work. As soon as you do something like add that intersection, it stops working.
typescript-bot commentedon Aug 12, 2024
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.