From 27d56c470ce2a95059ccc6439f2e98ba9b8073e2 Mon Sep 17 00:00:00 2001 From: ahmad Date: Sun, 30 Jun 2024 21:09:48 +0200 Subject: [PATCH] Catch retrieving the field variable without this --- .../de/maishai/typedast/typedclass/TypedFieldVarAccess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {