From 4bc38c0ff904271e8231e074441a5fefbbbc7063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krau=C3=9F=2C=20Josefine?= Date: Fri, 28 Jun 2024 19:32:44 +0200 Subject: [PATCH] missing thisClass --- src/main/java/abstractSyntaxTree/Statement/LocalVarDecl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/abstractSyntaxTree/Statement/LocalVarDecl.java b/src/main/java/abstractSyntaxTree/Statement/LocalVarDecl.java index 5413556..9e986a4 100644 --- a/src/main/java/abstractSyntaxTree/Statement/LocalVarDecl.java +++ b/src/main/java/abstractSyntaxTree/Statement/LocalVarDecl.java @@ -5,7 +5,9 @@ import TypeCheck.TypeCheckException; import TypeCheck.TypeCheckHelper; import TypeCheck.TypeCheckResult; import abstractSyntaxTree.Expression.IExpression; +import abstractSyntaxTree.Expression.LocalVarIdentifier; import abstractSyntaxTree.Parameter.ParameterList; +import abstractSyntaxTree.StatementExpression.AssignStatementExpression; import abstractSyntaxTree.StatementExpression.MethodCallStatementExpression; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; @@ -36,6 +38,9 @@ public class LocalVarDecl extends AbstractType implements IStatement{ methodCall.thisClass = this.thisClass; } + if(expression instanceof LocalVarIdentifier localVarIdentifier){ + localVarIdentifier.thisClass = thisClass; + } expression.typeCheck(methodContext, typeContext, localVars); }