File tree 1 file changed +6
-0
lines changed
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 {
1501
1501
let thisInstanceMembers = thisPrototype . instanceMembers ;
1502
1502
if ( thisInstanceMembers ) {
1503
1503
let thisMembers = Map_values ( thisInstanceMembers ) ;
1504
+ let seen : Set < ClassPrototype > | null = null ;
1504
1505
do {
1505
1506
let baseInstanceMembers = basePrototype . instanceMembers ;
1506
1507
if ( baseInstanceMembers ) {
@@ -1525,6 +1526,11 @@ export class Program extends DiagnosticEmitter {
1525
1526
}
1526
1527
let nextPrototype = basePrototype . basePrototype ;
1527
1528
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.
1528
1534
basePrototype = nextPrototype ;
1529
1535
} while ( true ) ;
1530
1536
}
You can’t perform that action at this time.
0 commit comments