Skip to content

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

Merged
sandersn merged 2 commits into
microsoft:masterfrom
jameskeane:fix-erroneous-TS2350
Aug 1, 2018
Merged

Fixes #26122 - erroneous "TS2350" for js constructors called with incorrect parameters#26124
sandersn merged 2 commits into
microsoft:masterfrom
jameskeane:fix-erroneous-TS2350

Conversation

@jameskeane
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@sandersn thanks!

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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