Check whether we have a class before testing whether we have a super-class.

This commit is contained in:
Daniel Rosenwasser committed 2017-12-29 12:30:27 -08:00
1 parent 0d56a0545c
commit ea94a3430d
1 file changed
+3
+3
View File
@@ -15872,6 +15872,9 @@ namespace ts {
* In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration.
*/
function isPropertyDeclaredInAncestorClass(prop: Symbol): boolean {
if (!(prop.parent.flags & SymbolFlags.Class)) {
return false;
}
let classType = getTypeOfSymbol(prop.parent) as InterfaceType;
while (true) {
classType = getSuperClass(classType);