Skip to content

Commit

Permalink
Check whether we have a class before testing whether we have a super-…
Browse files Browse the repository at this point in the history
…class.
  • Loading branch information
DanielRosenwasser committed Dec 29, 2017
1 parent 0d56a05 commit ea94a34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ea94a34

Please sign in to comment.