diff --git a/ts2panda/src/expression/callExpression.ts b/ts2panda/src/expression/callExpression.ts index ef5336575c466d9a04be4cb3fa493890938bde15..837b1126a0813d8b5e2a36fc288fd4d75d2a99bc 100644 --- a/ts2panda/src/expression/callExpression.ts +++ b/ts2panda/src/expression/callExpression.ts @@ -65,7 +65,11 @@ export function getHiddenParameters(expr: ts.Expression, compiler: Compiler) { if ((expr).expression.kind == ts.SyntaxKind.SuperKeyword) { compileSuperProperty(compiler, expr, thisReg, prop); } else { - pandaGen.loadObjProperty(expr, thisReg, prop); + pandaGen.loadObjProperty( + ts.isPropertyAccessExpression(expr) ? expr.name : (expr).argumentExpression, + thisReg, + prop + ); } pandaGen.storeAccumulator(expr, funcReg); args.push(...[funcReg, thisReg]); diff --git a/ts2panda/src/expression/memberAccessExpression.ts b/ts2panda/src/expression/memberAccessExpression.ts index b50bbfbc8cce6cc0af6ec4dae464cb6550ced3a0..1183bb7befba05e6fae1b876048ae497a445408f 100644 --- a/ts2panda/src/expression/memberAccessExpression.ts +++ b/ts2panda/src/expression/memberAccessExpression.ts @@ -34,7 +34,11 @@ export function compileMemberAccessExpression(node: ts.ElementAccessExpression | compileSuperProperty(compiler, node, thisReg, property); pandaGen.freeTemps(thisReg); } else { - pandaGen.loadObjProperty(node, obj, property); + pandaGen.loadObjProperty( + ts.isPropertyAccessExpression(node) ? node.name : node.argumentExpression, + obj, + property + ); } pandaGen.freeTemps(objReg, propReg);