mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 15:12:12 +00:00
Fix unsupported element access on 'this', see #349
This commit is contained in:
parent
7596d73284
commit
1d93877e7c
@ -505,7 +505,7 @@ export class Resolver extends DiagnosticEmitter {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ElementKind.CLASS: { // element access on element access
|
case ElementKind.CLASS: {
|
||||||
let indexedGet = (<Class>target).lookupOverload(OperatorKind.INDEXED_GET);
|
let indexedGet = (<Class>target).lookupOverload(OperatorKind.INDEXED_GET);
|
||||||
if (!indexedGet) {
|
if (!indexedGet) {
|
||||||
if (reportMode == ReportMode.REPORT) {
|
if (reportMode == ReportMode.REPORT) {
|
||||||
@ -516,13 +516,18 @@ export class Resolver extends DiagnosticEmitter {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
let returnType = indexedGet.signature.returnType;
|
if (targetExpression.kind == NodeKind.ELEMENTACCESS) { // nested element access
|
||||||
if (target = returnType.classReference) {
|
let returnType = indexedGet.signature.returnType;
|
||||||
this.currentThisExpression = targetExpression;
|
if (target = returnType.classReference) {
|
||||||
this.currentElementExpression = elementAccess.elementExpression;
|
this.currentThisExpression = targetExpression;
|
||||||
return target;
|
this.currentElementExpression = elementAccess.elementExpression;
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
break;
|
this.currentThisExpression = targetExpression;
|
||||||
|
this.currentElementExpression = elementAccess.elementExpression;
|
||||||
|
return target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (reportMode == ReportMode.REPORT) {
|
if (reportMode == ReportMode.REPORT) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user