mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 05:48:31 +00:00
Debug enum issue
This commit is contained in:
parent
8c39cdc89f
commit
9395162a7c
@ -19149,6 +19149,7 @@ static TypeTableEntry *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira
|
||||
if (!end_val)
|
||||
return ira->codegen->builtin_types.entry_invalid;
|
||||
|
||||
printf("%s\n", buf_ptr(&start_val->type->name));
|
||||
assert(start_val->type->id == TypeTableEntryIdInt || start_val->type->id == TypeTableEntryIdComptimeInt);
|
||||
assert(end_val->type->id == TypeTableEntryIdInt || end_val->type->id == TypeTableEntryIdComptimeInt);
|
||||
AstNode *prev_node = rangeset_add_range(&rs, &start_val->data.x_bigint, &end_val->data.x_bigint,
|
||||
|
||||
@ -52,6 +52,7 @@ comptime {
|
||||
_ = @import("cases/switch.zig");
|
||||
_ = @import("cases/switch_prong_err_enum.zig");
|
||||
_ = @import("cases/switch_prong_implicit_cast.zig");
|
||||
_ = @import("cases/switch_usize_enum_prongs.zig");
|
||||
_ = @import("cases/syntax.zig");
|
||||
_ = @import("cases/this.zig");
|
||||
_ = @import("cases/try.zig");
|
||||
|
||||
11
test/cases/switch_usize_enum_prongs.zig
Normal file
11
test/cases/switch_usize_enum_prongs.zig
Normal file
@ -0,0 +1,11 @@
|
||||
const E = enum(usize) { One, Two };
|
||||
|
||||
test "aoeou" {
|
||||
foo(1);
|
||||
}
|
||||
|
||||
fn foo(x: usize) void {
|
||||
switch (x) {
|
||||
E.One => {},
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user