Skip to content

Fixes #26122 - erroneous "TS2350" for js constructors called with incorrect parameters #26124

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Aug 1, 2018

Conversation

jameskeane
Copy link
Contributor

@jameskeane jameskeane commented Aug 1, 2018

When resolveCall does not resolve a signature in resolveNewExpression, the error should only be thrown if there is a defined signature that is not-void.

Fixes #26122


Should we consider marking the call signatures of functions with @constructoras construct signatures (as in PR #25980). It caused a weird bug with typeFromPropertyAssignment12 that is probably worth understanding.

When `resolveCall` does not resolve in `resolveNewExpression`, the error should only be thrown if there is a *defined* signature that is not-void.
@ghost ghost requested a review from sandersn August 1, 2018 19:17
@jameskeane jameskeane changed the title Fixes #26122 - erroneous "TS2350" for js tagged constructors called with incorrect parameters Fixes #26122 - erroneous "TS2350" for js constructors called with incorrect parameters Aug 1, 2018
@sandersn
Copy link
Member

sandersn commented Aug 1, 2018

Re switching call to construct signatures: Probably yes, but there's a lot of code that expects constructor functions to have call signatures. It won't be a trivial change, I think.

The compiler has supported constructor functions for a long time, but TS support is quite limited so there weren't many places to change until a year or two ago.

@sandersn sandersn merged commit 50f442f into microsoft:master Aug 1, 2018
@jameskeane
Copy link
Contributor Author

@sandersn thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSDoc, Erroneous "TS2350" for js tagged constructors called with incorrect parameters.
2 participants