Compare commits

...

2 Commits

Author SHA1 Message Date
Krauß, Josefine
d2b307f86f Merge remote-tracking branch 'origin/master' 2024-07-01 11:19:42 +02:00
Krauß, Josefine
5b0dc04bd7 reached in wrong class and missing typecheckcall on parameters iexpression 2024-07-01 11:19:31 +02:00

View File

@ -57,7 +57,7 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr
receiver.instVarExpression.typeCheck(methodContext, typeContext, localVars);
currentType = typeContext.get(typeOfSubreceiver).get(mostLeftField);
} else {
currentType = thisClass;
currentType = classToSearchMethodIn;
}
} else {
currentType = thisClass;
@ -74,6 +74,9 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr
}
currentType = (String) methodContext.get(currentType).get(methodName).keySet().toArray()[0];
for (IExpression argument : arguments) {
argument.typeCheck(methodContext, typeContext, localVars);
}
TypeCheckResult result = new TypeCheckResult();
result.type = currentType;
setTypeCheckResult(result);