Procházet zdrojové kódy

Fix error handling for type switch statement

gingerBill před 1 rokem
rodič
revize
65cb382135
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      src/check_stmt.cpp

+ 2 - 0
src/check_stmt.cpp

@@ -1365,6 +1365,8 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_
 		}
 		}
 
 
 		if (unhandled.count > 0) {
 		if (unhandled.count > 0) {
+			ERROR_BLOCK();
+
 			if (unhandled.count == 1) {
 			if (unhandled.count == 1) {
 				gbString s = type_to_string(unhandled[0]);
 				gbString s = type_to_string(unhandled[0]);
 				error_no_newline(node, "Unhandled switch case: %s", s);
 				error_no_newline(node, "Unhandled switch case: %s", s);