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
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.
π Search Terms
function union infer
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?jsx=0#code/C4TwDgpgBAYgrgOwMbAJYHsEEMA2BhdAWzEwgWAB4AVAPigF4oAKMAJ3TAGcAuKKgSgZ1OwVqgQBzANwAoGUkwiowCEsbUaLdl14BvKADdccVbyoBtALoAaKJwg4IKCABMzUAL6D6dXTKgBUAoISrpGOCactvaOzi4eDFBsHJyygVCsEMBwrAhQAAYqIrwAJGHGqh7RDk4qblBlMbWuHvmyHrLBSgTEpOQAClicIgAW7HASI4kaTArEvPDIaJi4PSQIZJS0-AuIKBjY+ETrmxpCQcey8orAUGt9wACCE4Sb07Szx7tLB6vHDxodrA9stDvcNuQzgAyKD6VD1BBwQgAIwgrE85wA8siAFa1AB0Q04qAkCE+xFscPqAEYAAyefhXLq3LCJcGbQbDYBjdATEZMIrARnXEK3ZFs-4Qp4vTYC1RCqRAA
π» Code
π Actual behavior
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:
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: