c bool support and c-integer coercion
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user