c bool support and c-integer coercion

This commit is contained in:
2026-06-25 17:53:04 +02:00
parent c08bc6d0cc
commit e0b6f6049c
10 changed files with 80 additions and 13 deletions
+14
View File
@@ -1882,6 +1882,20 @@ coerce_expr :: proc(
},
)
}
if types.can_coerce_c_integer(actual, expected) {
return add_hir_expr(
checker,
hir.Expr {
kind = .C_Coerce,
span = span,
type = expected,
left = expr_id,
target = hir.INVALID_REF,
right = hir.INVALID_EXPR,
diagnostic = source.INVALID_DIAGNOSTIC,
},
)
}
id := source.addf(
checker.diagnostics,
span,