Check for ClassDeclaration in getBaseTypeNodeOfClass

Previously, it just used valueDeclaration. Now, it searches the
declarations.
This commit is contained in:
Nathan Shively-Sanders
2015-10-08 16:39:53 -07:00
parent ff43d464fc
commit 08c78fbe76
+4 -1
View File
@@ -2766,7 +2766,10 @@ namespace ts {
}
function getBaseTypeNodeOfClass(type: InterfaceType): ExpressionWithTypeArguments {
return getClassExtendsHeritageClauseElement(<ClassLikeDeclaration>type.symbol.valueDeclaration);
let classDeclaration = getDeclarationOfKind(type.symbol, SyntaxKind.ClassDeclaration);
if (classDeclaration) {
return getClassExtendsHeritageClauseElement(classDeclaration as ClassLikeDeclaration);
}
}
function getConstructorsForTypeArguments(type: ObjectType, typeArgumentNodes: TypeNode[]): Signature[] {