From 56ff5496bc81ca2ccce00f46d9477c6d559ee5b0 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 12 May 2018 16:53:44 +0100 Subject: Minimal Type Info Dependency handling --- src/check_stmt.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/check_stmt.cpp') 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"); } -- cgit v1.2.3