diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java b/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java index 7b6309d..af9c2b9 100644 --- a/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java +++ b/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java @@ -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) {