Fixed TypedUnary Type

This commit is contained in:
Ahmad 2024-06-23 17:15:51 +02:00
parent 7b163baa13
commit e2937b13e5

View File

@ -42,7 +42,7 @@ public class TypedUnary implements TypedExpression {
if (right.typeCheck(typedProgram) != Type.INT) {
throw new RuntimeException("Minus operator must be applied to int");
}
return Type.INT;
return Type.BOOL;
}
throw new RuntimeException("Unknown unary operator");
}