Improve update expr type semantics for ternary expressions

This commit is contained in:
gingerBill
2021-07-10 11:08:51 +01:00
parent f6c1a5bf6e
commit e692efbe09
2 changed files with 20 additions and 15 deletions

View File

@@ -4427,6 +4427,13 @@ void check_parsed_files(Checker *c) {
if (is_type_typed(info->type)) {
compiler_error("%s (type %s) is typed!", expr_to_string(expr), type_to_string(info->type));
}
if (info->mode == Addressing_Constant) {
} else if (info->type == t_untyped_nil) {
} else if (info->type == t_untyped_undef) {
} else if (info->type == t_untyped_bool) {
} else {
gb_printf_err("UNTYPED %s %s\n", expr_to_string(expr), type_to_string(info->type));
}
add_type_and_value(&c->info, expr, info->mode, info->type, info->value);
}
}