File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1501,6 +1501,7 @@ export class Program extends DiagnosticEmitter {
15011501 let thisInstanceMembers = thisPrototype . instanceMembers ;
15021502 if ( thisInstanceMembers ) {
15031503 let thisMembers = Map_values ( thisInstanceMembers ) ;
1504+ let seen : Set < ClassPrototype > | null = null ;
15041505 do {
15051506 let baseInstanceMembers = basePrototype . instanceMembers ;
15061507 if ( baseInstanceMembers ) {
@@ -1525,6 +1526,11 @@ export class Program extends DiagnosticEmitter {
15251526 }
15261527 let nextPrototype = basePrototype . basePrototype ;
15271528 if ( ! nextPrototype ) break ;
1529+ // Break on circular inheritance. Is diagnosed later, when resolved.
1530+ if ( ! seen ) seen = new Set ( ) ;
1531+ seen . add ( basePrototype ) ;
1532+ if ( seen . has ( nextPrototype ) ) break ;
1533+ // Otherwise traverse to next base prototype.
15281534 basePrototype = nextPrototype ;
15291535 } while ( true ) ;
15301536 }
You can’t perform that action at this time.
0 commit comments