Browse Source

Improve printing for unhandled cases by adding a new line before the cases

gingerBill 3 years ago
parent
commit
67ce0ec29f
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/check_expr.cpp
  2. 1 1
      src/check_stmt.cpp

+ 1 - 1
src/check_expr.cpp

@@ -8188,7 +8188,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
 					if (unhandled.count == 1) {
 						error_no_newline(node, "Unhandled enumerated array case: %.*s", LIT(unhandled[0]->token.string));
 					} else {
-						error_no_newline(node, "Unhandled enumerated array cases: ");
+						error(node, "Unhandled enumerated array cases:");
 						for_array(i, unhandled) {
 							Entity *f = unhandled[i];
 							error_line("\t%.*s\n", LIT(f->token.string));

+ 1 - 1
src/check_stmt.cpp

@@ -1065,7 +1065,7 @@ void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) {
 			if (unhandled.count == 1) {
 				error_no_newline(node, "Unhandled switch case: %.*s", LIT(unhandled[0]->token.string));
 			} else {
-				error_no_newline(node, "Unhandled switch cases: ");
+				error(node, "Unhandled switch cases:");
 				for_array(i, unhandled) {
 					Entity *f = unhandled[i];
 					error_line("\t%.*s\n", LIT(f->token.string));