diff options
| author | gingerBill <bill@gingerbill.org> | 2018-06-15 19:59:35 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-06-15 19:59:35 +0100 |
| commit | 5081ea1a0c2469ed77531a6a6718a9de86f1d140 (patch) | |
| tree | 1d66bd9a94fe6d97575dd7f4cb6d2d21e5871dac /src/check_stmt.cpp | |
| parent | e9e7ce2606ae18dd96fde356860fe613ff5c5430 (diff) | |
Fix type aliasing comparison; Fix gb_utf8_decode
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 42495d682..c9a1ad4d8 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -946,8 +946,8 @@ void check_type_switch_stmt(CheckerContext *ctx, AstNode *node, u32 mod_flags) { if (switch_kind == TypeSwitch_Union) { GB_ASSERT(is_type_union(bt)); bool tag_type_found = false; - for_array(i, bt->Union.variants) { - Type *vt = bt->Union.variants[i]; + for_array(j, bt->Union.variants) { + Type *vt = bt->Union.variants[j]; if (are_types_identical(vt, y.type)) { tag_type_found = true; break; @@ -955,7 +955,11 @@ void check_type_switch_stmt(CheckerContext *ctx, AstNode *node, u32 mod_flags) { } if (!tag_type_found) { gbString type_str = type_to_string(y.type); - error(y.expr, "Unknown tag type, got '%s'", type_str); + error(y.expr, "Unknown variant type, got '%s'", type_str); + for_array(j, bt->Union.variants) { + Type *vt = base_type(bt->Union.variants[j]); + gb_printf_err("\t%s\n", type_to_string(vt)); + } gb_string_free(type_str); continue; } |