-
Notifications
You must be signed in to change notification settings - Fork 13.4k
partial function with generic lost the type constraint #57072
Copy link
Copy link
Open
Labels
Domain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Metadata
Metadata
Assignees
Labels
Domain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
🔎 Search Terms
generic
partial function with generic lose the type constraint
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.4.0-dev.20240107#code/PTAEFsEsDtPBDANqATgUwA4oPYBMCuAxmgFAkAuAnhmqAIIoqgC8qa8u20ilo80lANoBdMgDN80QuUhdQGeChlIAwkkQAeACqg0AD3JpouAM71GAGlABVXQaOnzKKwCUAfAAoSoUGIBcoB4AdCGKAOYmAYIhQVpWMdbCAJQsbqAuFt6gMQAW7LgMEQFaJCkA3lno5Pgo0IEx5PCQiIWRNinMaWLBIXkcrfEhjc2tSSQAvmSEXCbkEPCEOTBozBU+WJDEAQDMAAyZPvBhaH4AjLsT4pLSsnXQ+OAqOfzH2naGxmYuaNMouBqzFAwMJWe7gABGaBQbk8oGw4IAVn44qAANZoSgBdGUbBiUAo3BoRCNAJgyEoJJrHw+Ko1OrwhGCbHCADUhOJ8EuEikMjkYKeLzQpze+g+jm+v3+gOBoIe5JhHjRGKxGNx+KsDORFnZJNAZKhlKy1NptThiKZGNZOs5kxI02gs1AhkdrH5z2gxw8CEWy1AVgA5Ec0P6rOcxiQQKAAALkEwAWn0NGkCcY2BQdpmc2d5FOLD1DwFHrQXoWS2gaAsgZD5z94YzDrm3rLaAAcgX3cdWAolJBVOoPG7BVYm8tw5GTDlsPhELhQJBQCY0LR4LpU0w8uhQAB+euOwynVgj8ttx4d4tViwAJl2YyAA
💻 Code
🙁 Actual behavior
I'm using a partial function with passing another generic function , the returned function loses the type restrictions on its parameters.
🙂 Expected behavior
the returned function have the type restrictions on its parameters
Additional information about the issue
No response