mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Always check extends clause of classes
Even if (1) @extends is provided and (2) we're not producing diagnostics. That's because we need to know whether the extends clause references an imported alias.
This commit is contained in:
@@ -27424,6 +27424,11 @@ namespace ts {
|
||||
if (languageVersion < ScriptTarget.ES2015) {
|
||||
checkExternalEmitHelpers(baseTypeNode.parent, ExternalEmitHelpers.Extends);
|
||||
}
|
||||
// check both @extends and extends if both are specified.
|
||||
const extendsNode = getClassExtendsHeritageElement(node);
|
||||
if (extendsNode && extendsNode !== baseTypeNode) {
|
||||
checkExpression(extendsNode.expression);
|
||||
}
|
||||
|
||||
const baseTypes = getBaseTypes(type);
|
||||
if (baseTypes.length && produceDiagnostics) {
|
||||
@@ -27432,10 +27437,6 @@ namespace ts {
|
||||
const staticBaseType = getApparentType(baseConstructorType);
|
||||
checkBaseTypeAccessibility(staticBaseType, baseTypeNode);
|
||||
checkSourceElement(baseTypeNode.expression);
|
||||
const extendsNode = getClassExtendsHeritageElement(node);
|
||||
if (extendsNode && extendsNode !== baseTypeNode) {
|
||||
checkExpression(extendsNode.expression);
|
||||
}
|
||||
if (some(baseTypeNode.typeArguments)) {
|
||||
forEach(baseTypeNode.typeArguments, checkSourceElement);
|
||||
for (const constructor of getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode)) {
|
||||
|
||||
Reference in New Issue
Block a user