Catch retrieving the field variable without this

This commit is contained in:
ahmad 2024-06-30 21:09:48 +02:00
parent b4fd003f8e
commit 27d56c470c

View File

@ -116,7 +116,7 @@ public class TypedFieldVarAccess implements TypedExpression {
TypedClass currentClass = typedProgram.getCurrentClass();
if (currentClass.isThereField(name)) {
type = currentClass.getFieldType(name);
throw new RuntimeException("Field Variable " + name + " should be used with `this´");
} else if (currentClass.isMethodOfCurrentClass(name)) {
type = currentClass.getMethodType(name);
} else if (recursiveOwnerChain instanceof TypedFieldVarAccess typedFieldVarAccess) {