diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java b/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java index 9b6c7c5..681de57 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) {