Commit 9395162a7c
Changed files (3)
src
test
src/ir.cpp
@@ -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,
test/cases/switch_usize_enum_prongs.zig
@@ -0,0 +1,11 @@
+const E = enum(usize) { One, Two };
+
+test "aoeou" {
+ foo(1);
+}
+
+fn foo(x: usize) void {
+ switch (x) {
+ E.One => {},
+ }
+}
test/behavior.zig
@@ -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");