add: check duplicates in type switches

This commit is contained in:
Abderrahim Indjaren
2026-05-18 03:15:55 +01:00
parent 97482f53f4
commit d02c5e1a21
2 changed files with 41 additions and 1 deletions

View File

@@ -1296,6 +1296,7 @@ gb_internal void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags
}
t = default_type(t);
add_type_info_type(ctx, t);
add_type_to_seen_map(ctx, &seen, y);
} else {
convert_to_typed(ctx, &y, x.type);
if (y.mode == Addressing_Invalid) {