mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-21 15:05:45 -07:00
+13
-3
@@ -1578,6 +1578,19 @@ void check_collect_entities(Checker *c, AstNodeArray nodes, bool is_file_scope)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fl->cond != NULL) {
|
||||
Operand operand = {Addressing_Invalid};
|
||||
check_expr(c, &operand, fl->cond);
|
||||
if (operand.mode != Addressing_Constant || !is_type_boolean(operand.type)) {
|
||||
error_node(fl->cond, "Non-constant boolean `when` condition");
|
||||
continue;
|
||||
}
|
||||
if (operand.value.kind == ExactValue_Bool &&
|
||||
!operand.value.value_bool) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
DelayedDecl di = {c->context.scope, decl};
|
||||
array_add(&c->delayed_foreign_libraries, di);
|
||||
case_end;
|
||||
@@ -2004,6 +2017,3 @@ void check_parsed_files(Checker *c) {
|
||||
map_scope_destroy(&file_scopes);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user