Browse Source

Fix #complete switch on pointers to unions #286

gingerBill 6 years ago
parent
commit
a747c03f29
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/check_stmt.cpp

+ 1 - 1
src/check_stmt.cpp

@@ -1008,7 +1008,7 @@ void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) {
 	}
 
 	if (complete) {
-		Type *ut = base_type(x.type);
+		Type *ut = base_type(type_deref(x.type));
 		GB_ASSERT(is_type_union(ut));
 		auto variants = ut->Union.variants;