mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-09 22:32:13 -04:00
Add suggestion for ternary if with simd
This commit is contained in:
1 parent
42d3f78bae
commit
2094cd4768
2 files changed
+8
-4
No files matched your search
@@ -9681,7 +9681,11 @@ gb_internal ExprKind check_ternary_if_expr(CheckerContext *c, Operand *o, Ast *n
|
||||
node->viral_state_flags |= te->cond->viral_state_flags;
|
||||
|
||||
if (cond.mode != Addressing_Invalid && !is_type_boolean(cond.type)) {
|
||||
ERROR_BLOCK();
|
||||
error(te->cond, "Non-boolean condition in ternary if expression");
|
||||
if (is_type_simd_vector(cond.type)) {
|
||||
error_line("\tSuggestion: Use 'simd.select' a ternary-like operation is required\n");
|
||||
}
|
||||
}
|
||||
|
||||
Operand x = {Addressing_Invalid};
|
||||
|
||||
Reference in new issue
Block a user