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;
|
||||
}
|
||||
case ElementKind.CLASS: { // element access on element access
|
||||
case ElementKind.CLASS: {
|
||||
let indexedGet = (<Class>target).lookupOverload(OperatorKind.INDEXED_GET);
|
||||
if (!indexedGet) {
|
||||
if (reportMode == ReportMode.REPORT) {
|
||||
@ -516,13 +516,18 @@ export class Resolver extends DiagnosticEmitter {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
let returnType = indexedGet.signature.returnType;
|
||||
if (target = returnType.classReference) {
|
||||
this.currentThisExpression = targetExpression;
|
||||
this.currentElementExpression = elementAccess.elementExpression;
|
||||
return target;
|
||||
if (targetExpression.kind == NodeKind.ELEMENTACCESS) { // nested element access
|
||||
let returnType = indexedGet.signature.returnType;
|
||||
if (target = returnType.classReference) {
|
||||
this.currentThisExpression = targetExpression;
|
||||
this.currentElementExpression = elementAccess.elementExpression;
|
||||
return target;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
this.currentThisExpression = targetExpression;
|
||||
this.currentElementExpression = elementAccess.elementExpression;
|
||||
return target;
|
||||
}
|
||||
}
|
||||
if (reportMode == ReportMode.REPORT) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user