diff --git a/src/main/java/de/maishai/StatementGenerator.java b/src/main/java/de/maishai/StatementGenerator.java index fa98767..268642c 100644 --- a/src/main/java/de/maishai/StatementGenerator.java +++ b/src/main/java/de/maishai/StatementGenerator.java @@ -105,7 +105,6 @@ public class StatementGenerator extends DecafBaseVisitor> { Expression recipient = null; if (fieldIdContext.recipient() != null) { recipient = ExpressionGenerator.generateRecursiveOwnerChain(fieldIdContext.recipient(), null, isField); - } if (recipient == null) { return new FieldVarAccess(isField, null, fieldIdContext.id().IDENTIFIER().getText()); diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java b/src/main/java/de/maishai/typedast/typedclass/TypedFieldVarAccess.java index af9c2b9..681de57 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)) { - throw new RuntimeException("Field Variable " + name + " should be used with `thisĀ“"); + return checkTypeField(typedProgram); } else if (currentClass.isMethodOfCurrentClass(name)) { type = currentClass.getMethodType(name); return type;