Minimal Type Info Dependency handling

This commit is contained in:
gingerBill
2018-05-12 16:53:44 +01:00
parent 20fbece14c
commit 56ff5496bc
6 changed files with 226 additions and 41 deletions
+3
View File
@@ -871,6 +871,7 @@ void check_type_switch_stmt(Checker *c, AstNode *node, u32 mod_flags) {
check_expr(c, &x, rhs);
check_assignment(c, &x, nullptr, str_lit("type switch expression"));
add_type_info_type(c, x.type);
TypeSwitchKind switch_kind = check_valid_type_switch_type(x.type);
if (switch_kind == TypeSwitch_Invalid) {
@@ -962,8 +963,10 @@ void check_type_switch_stmt(Checker *c, AstNode *node, u32 mod_flags) {
continue;
}
case_type = y.type;
add_type_info_type(c, y.type);
} else if (switch_kind == TypeSwitch_Any) {
case_type = y.type;
add_type_info_type(c, y.type);
} else {
GB_PANIC("Unknown type to type switch statement");
}