-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presence of a binding pattern changes inference for callback function parameters #43605
Comments
Slightly reduced, cleaned up, and emphasizing the nature of the bug: playground |
Moving to 4.5 since the fix will probably be a breaking change |
Looking at this again, it is very weird, but it is expected behavior. See #39081 for some discussion. The real problem is that |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
🕗 Version & Regression Information
This bugs occurs in typescript 4.2.3, 4.2.4 and 4.3.0-beta, I didn't test the older typescripts.
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
In the function call on line 55, typescript cannot infer the parameters of array functions
funcA
,funcB
andfuncC
, actually it thinks the parameters...args
isany[]
.But this bugs doesn't occur in function calls on line 46, 50, 58 and 63.
🙂 Expected behavior
No compilation errors.
Typescript should infer the parameters
...args
of array functionfuncA
,funcB
andfuncC
correctly.The text was updated successfully, but these errors were encountered: