feat(selfhost-sema): arithmetic errors return tyUnknown sentinel

This commit is contained in:
2026-07-28 20:33:21 +03:00
parent 44ecbd6873
commit 76ea9cc083
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -966,7 +966,7 @@ module Sema {
if op == tkAmpAmp || op == tkPipePipe || op == tkBang { return tyBool; }
// Arithmetic returns wider type
if !Sema_IsNumeric(left) || !Sema_IsNumeric(right) {
Sema_EmitError(sema, expr.line, expr.column, "arithmetic requires numeric operands");
return Sema_EmitExprError(sema, expr, "arithmetic requires numeric operands");
}
if left == tyFloat64 || right == tyFloat64 { return tyFloat64; }
return tyInt;