Skip to content

Commit 996bff5

Browse files
authored
Use base index signature if inherited (AssemblyScript#1152)
1 parent 1d25051 commit 996bff5

File tree

4 files changed

+665
-65
lines changed

4 files changed

+665
-65
lines changed

src/resolver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,13 +1486,14 @@ export class Resolver extends DiagnosticEmitter {
14861486
if (!targetType) return null;
14871487
if (targetType.is(TypeFlags.REFERENCE)) {
14881488
let classReference = targetType.classReference;
1489-
if (classReference) {
1489+
while (classReference) {
14901490
let indexSignature = classReference.indexSignature;
14911491
if (indexSignature) {
14921492
this.currentThisExpression = targetExpression;
14931493
this.currentElementExpression = node.elementExpression;
14941494
return indexSignature;
14951495
}
1496+
classReference = classReference.base;
14961497
}
14971498
}
14981499
if (reportMode == ReportMode.REPORT) {

0 commit comments

Comments
 (0)