-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Contextually type parameters in super calls using type arguments on the base class. #1816
Conversation
|
||
constructor() { | ||
|
||
super("hi"); // Should error, base constructor has type T for first arg, which is fixed as number in the extends clause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, the word you want is "instantiated" rather than "fixed"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't write it, but I'll consider fixing it.
👍 |
// Instead, they must be fetched from the class declaration's base type node. | ||
function getEffectiveTypeArguments(callExpression: CallExpression): TypeNode[] { | ||
if (callExpression.expression.kind === SyntaxKind.SuperKeyword) { | ||
// TODO (drosen): 1) Discuss if checking needs to be done at this point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
lgtm |
Contextually type parameters in super calls using type arguments on the base class.
Seems like we might not even have been performing overload resolution correctly here.
Fixes #1480.