diff options
| author | gingerBill <bill@gingerbill.org> | 2018-05-12 16:53:44 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-05-12 16:53:44 +0100 |
| commit | 56ff5496bc81ca2ccce00f46d9477c6d559ee5b0 (patch) | |
| tree | 526a23cebbb92a4e78e61bbfa92b4c9cd4b75310 /src/check_stmt.cpp | |
| parent | 20fbece14cc1da70964ef20bf8fdd7fc7261b509 (diff) | |
Minimal Type Info Dependency handling
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 13b95ddad..72c6f5487 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -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"); } |