Skip to content

Commit 994b73f

Browse files
author
Arthur Ozga
committed
fixed an erroneous assertion
1 parent 5864a66 commit 994b73f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11703,10 +11703,12 @@ namespace ts {
1170311703
// derived class inherits base without override/redeclaration
1170411704

1170511705
let derivedClassDecl = getDeclarationOfKind(type.symbol, SyntaxKind.ClassDeclaration);
11706-
Debug.assert(derivedClassDecl !== undefined);
11706+
// Debug.assert(derivedClassDecl !== undefined);
1170711707

1170811708
// It is an error to inherit an abstract member without implementing it or being declared abstract.
11709-
if ((baseDeclarationFlags & NodeFlags.Abstract) && !(derivedClassDecl.flags & NodeFlags.Abstract)) {
11709+
// If there is no declaration for the derived class (as in the case of class expressions),
11710+
// then the class cannot be declared abstract.
11711+
if ( baseDeclarationFlags & NodeFlags.Abstract && (!derivedClassDecl || !(derivedClassDecl.flags & NodeFlags.Abstract))) {
1171011712
error(derivedClassDecl, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
1171111713
typeToString(type), symbolToString(baseProperty), typeToString(baseType));
1171211714
}

0 commit comments

Comments
 (0)