From ea94a3430dbd7d39692578f2e80d890e5847d5ff Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 28 Dec 2017 15:43:20 -0800 Subject: [PATCH] Check whether we have a class before testing whether we have a super-class. --- src/compiler/checker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 82ab87d3160..af772733f05 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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);