Skip to content

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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