| author | |
| committer | |
| log | c9a5a6b83abaeef232ce3f0d2407c59f8769e9e5 |
| tree | 8bf044403c85b149462d29356a81b976c262a722 |
| parent | 3b4a6679a6422d68cb1ee4ecd31819b527b01c3b |
| signature |
closes #30462 files changed, 20 insertions(+), 0 deletions(-)
test/stage1/behavior.zig+1| ... | ... | @@ -31,6 +31,7 @@ comptime { |
| 31 | 31 | _ = @import("behavior/bugs/2346.zig"); |
| 32 | 32 | _ = @import("behavior/bugs/2578.zig"); |
| 33 | 33 | _ = @import("behavior/bugs/2692.zig"); |
| 34 | _ = @import("behavior/bugs/3046.zig"); | |
| 34 | 35 | _ = @import("behavior/bugs/3112.zig"); |
| 35 | 36 | _ = @import("behavior/bugs/394.zig"); |
| 36 | 37 | _ = @import("behavior/bugs/421.zig"); |
test/stage1/behavior/bugs/3046.zig created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | const std = @import("std"); | |
| 2 | const expect = std.testing.expect; | |
| 3 | ||
| 4 | const SomeStruct = struct { | |
| 5 | field: i32, | |
| 6 | }; | |
| 7 | ||
| 8 | fn couldFail() anyerror!i32 { | |
| 9 | return 1; | |
| 10 | } | |
| 11 | ||
| 12 | var some_struct: SomeStruct = undefined; | |
| 13 | ||
| 14 | test "fixed" { | |
| 15 | some_struct = SomeStruct{ | |
| 16 | .field = couldFail() catch |_| i32(0), | |
| 17 | }; | |
| 18 | expect(some_struct.field == 1); | |
| 19 | } |