Fall back to valueDeclaration

Fall back to `valueDeclaration` in getBaseTypeNodeOfClass when no
ClassDeclaration exists.
This commit is contained in:
Nathan Shively-Sanders 2015-10-09 10:12:17 -07:00
parent 08c78fbe76
commit 440d01f0bd

View File

@ -2766,10 +2766,9 @@ namespace ts {
}
function getBaseTypeNodeOfClass(type: InterfaceType): ExpressionWithTypeArguments {
let classDeclaration = getDeclarationOfKind(type.symbol, SyntaxKind.ClassDeclaration);
if (classDeclaration) {
return getClassExtendsHeritageClauseElement(classDeclaration as ClassLikeDeclaration);
}
let classDeclaration =
getDeclarationOfKind(type.symbol, SyntaxKind.ClassDeclaration) || type.symbol.valueDeclaration;
return getClassExtendsHeritageClauseElement(classDeclaration as ClassLikeDeclaration);
}
function getConstructorsForTypeArguments(type: ObjectType, typeArgumentNodes: TypeNode[]): Signature[] {