From 9b0d8147dbdcd33795a0dc501c79f8dda698def7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krau=C3=9F=2C=20Josefine?= Date: Mon, 1 Jul 2024 09:09:23 +0200 Subject: [PATCH] bugfix print should return void --- src/main/java/abstractSyntaxTree/Statement/PrintStatement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/abstractSyntaxTree/Statement/PrintStatement.java b/src/main/java/abstractSyntaxTree/Statement/PrintStatement.java index 8b5a870..96695bb 100644 --- a/src/main/java/abstractSyntaxTree/Statement/PrintStatement.java +++ b/src/main/java/abstractSyntaxTree/Statement/PrintStatement.java @@ -27,7 +27,7 @@ public class PrintStatement extends AbstractType implements IStatement { } if (!Objects.equals(typeOfVar, "int")) throw new TypeCheckException("The variable to be printed is " + typeOfVar + " but should be int."); - result.type = typeOfVar; + result.type = "void"; setTypeCheckResult(result); return result; }