Fixed some error handling for invalid if statements. Started if codegen.

This commit is contained in:
2025-01-18 22:22:16 +01:00
parent b4d119230b
commit 45ea54cf93
23 changed files with 344 additions and 11 deletions

View File

@@ -524,7 +524,11 @@ if_condition_has_to_be_boolean_type :: (checker : *Semantic_Checker, usage_site
indent(*builder, 1);
var := from_handle(checker, handle);
print_to_builder(*builder, "% has type %\n", print_from_source_location(*usage_site.children[0].source_location), proper_type_to_string(checker, var));
usage_child := usage_site.children[0];
usage_loc := usage_child.source_location;
print_to_builder(*builder, "% has type %\n", print_from_source_location(*usage_loc), proper_type_to_string(checker, var));
message := builder_to_string(*builder,, temp);
record_error(checker, message, usage_site.source_location, false);