Typechecker

- On processing of binary operations, if there is a type mismatch now a `TypeMismatchException` will be thrown instead of a print0out followed by an `assert(false)`
compiler_object
parent 59920286e2
commit 9332b955ff

@ -868,8 +868,7 @@ public final class TypeChecker
}
else
{
gprintln("Binary operator expression requires both types be same, but got '"~vRhsType.toString()~"' and '"~vLhsType.toString()~"'", DebugType.ERROR);
assert(false);
throw new TypeMismatchException(this, vLhsType, vRhsType, "Binary operator expression requires both types be same");
}
BinOpInstr addInst = new BinOpInstr(vLhsInstr, vRhsInstr, binOperator);

Loading…
Cancel
Save