| author | |
| committer | |
| log | 9395162a7c41689bcd1c0c48f9eabffc1485fc74 |
| tree | 8d3e4428c6c706fd7533874be030640799237966 |
| parent | 8c39cdc89f2ae7fc25c3856e7c4c6b4662ac8a80 |
3 files changed, 13 insertions(+), 0 deletions(-)
src/ir.cpp+1| ... | ... | @@ -19149,6 +19149,7 @@ static TypeTableEntry *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira |
| 19149 | 19149 | if (!end_val) |
| 19150 | 19150 | return ira->codegen->builtin_types.entry_invalid; |
| 19151 | 19151 | |
| 19152 | printf("%s\n", buf_ptr(&start_val->type->name)); | |
| 19152 | 19153 | assert(start_val->type->id == TypeTableEntryIdInt || start_val->type->id == TypeTableEntryIdComptimeInt); |
| 19153 | 19154 | assert(end_val->type->id == TypeTableEntryIdInt || end_val->type->id == TypeTableEntryIdComptimeInt); |
| 19154 | 19155 | AstNode *prev_node = rangeset_add_range(&rs, &start_val->data.x_bigint, &end_val->data.x_bigint, |
test/behavior.zig+1| ... | ... | @@ -52,6 +52,7 @@ comptime { |
| 52 | 52 | _ = @import("cases/switch.zig"); |
| 53 | 53 | _ = @import("cases/switch_prong_err_enum.zig"); |
| 54 | 54 | _ = @import("cases/switch_prong_implicit_cast.zig"); |
| 55 | _ = @import("cases/switch_usize_enum_prongs.zig"); | |
| 55 | 56 | _ = @import("cases/syntax.zig"); |
| 56 | 57 | _ = @import("cases/this.zig"); |
| 57 | 58 | _ = @import("cases/try.zig"); |
test/cases/switch_usize_enum_prongs.zig created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | const E = enum(usize) { One, Two }; | |
| 2 | ||
| 3 | test "aoeou" { | |
| 4 | foo(1); | |
| 5 | } | |
| 6 | ||
| 7 | fn foo(x: usize) void { | |
| 8 | switch (x) { | |
| 9 | E.One => {}, | |
| 10 | } | |
| 11 | } |