aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp3
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");
}