mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Improve warning handling for possible default: typo
This commit is contained in:
@@ -2031,6 +2031,12 @@ gb_internal void check_value_decl_stmt(CheckerContext *ctx, Ast *node, u32 mod_f
|
|||||||
gb_string_free(str);
|
gb_string_free(str);
|
||||||
init_type = t_invalid;
|
init_type = t_invalid;
|
||||||
}
|
}
|
||||||
|
if (init_type == t_invalid && entity_count == 1 && (mod_flags & (Stmt_BreakAllowed|Stmt_FallthroughAllowed))) {
|
||||||
|
Entity *e = entities[0];
|
||||||
|
if (e != nullptr && e->token.string == "default") {
|
||||||
|
warning(e->token, "Did you mean 'case:'?");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user