From 3ca35151a49d0b84c31a340589b2b1b02a0702cc Mon Sep 17 00:00:00 2001 From: ahmad Date: Fri, 28 Jun 2024 17:55:53 +0200 Subject: [PATCH] Updated TypedBinary --- .../java/de/maishai/typedast/typedclass/TypedBinary.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java b/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java index dadb292..5f94d76 100644 --- a/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java +++ b/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java @@ -55,14 +55,7 @@ public class TypedBinary implements TypedExpression { } else { throw new RuntimeException("Type mismatch in " + op); } - } else if (op == Operator.AND || op == Operator.OR) { - if (leftType == Type.BOOL && rightType == Type.BOOL) { - type = Type.BOOL; - return Type.BOOL; - } else { - throw new RuntimeException("Type mismatch in " + op); - } - } else if(op == Operator.EQ || op == Operator.NE){ + } else if(op == Operator.EQ || op == Operator.NE || op == Operator.AND || op == Operator.OR){ if(leftType == Type.INT && rightType == Type.INT || leftType == Type.BOOL && rightType == Type.BOOL){ type = Type.BOOL; return Type.BOOL;