Merge branch 'refs/heads/main' into testsuites

This commit is contained in:
JonathanFleischmann 2024-06-27 20:05:09 +02:00
commit 4be2af92f0

View File

@ -62,6 +62,13 @@ public class TypedBinary implements TypedExpression {
} else {
throw new RuntimeException("Type mismatch in " + op);
}
} else if(op == Operator.EQ || op == Operator.NE){
if(leftType == Type.INT && rightType == Type.INT || leftType == Type.BOOL && rightType == Type.BOOL){
type = Type.BOOL;
return Type.BOOL;
} else {
throw new RuntimeException("Type mismatch in " + op);
}
}
if (leftType == rightType && leftType != Type.VOID) {