From 0bfd9381f7e462f6841cffb6178217b48e022604 Mon Sep 17 00:00:00 2001 From: ahmad Date: Sun, 30 Jun 2024 21:10:49 +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..7b6309d 100644 --- a/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java +++ b/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java @@ -51,7 +51,7 @@ public class TypedFieldVarAccess implements TypedExpression { TypedClass currentClass = typedProgram.getCurrentClass(); if (currentClass.isThereField(name)) { - return checkTypeField(typedProgram); + throw new RuntimeException("Field Variable " + name + " should be used with `thisĀ“"); } else if (currentClass.isMethodOfCurrentClass(name)) { type = currentClass.getMethodType(name); return type;