diff options
| author | dweiller <4678790+dweiller@users.noreply.github.com> | 2023-12-30 12:58:35 +1100 |
|---|---|---|
| committer | dweiller <4678790+dweiller@users.noreply.github.com> | 2024-01-09 14:42:12 +1100 |
| commit | ec5b7513734fc7a6f7767dd721de8f6fa088b06d (patch) | |
| tree | 2f095f3af2287acf089ace7bb9cfb8ee12110264 /test | |
| parent | 69ab687156f1099570ec2208efae8be6883073c0 (diff) | |
| download | zig-ec5b7513734fc7a6f7767dd721de8f6fa088b06d.tar.gz zig-ec5b7513734fc7a6f7767dd721de8f6fa088b06d.zip | |
sema: inherit block want_safety for err switch union
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/inherit_want_safety.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cases/inherit_want_safety.zig b/test/cases/inherit_want_safety.zig index 6a70e603a6..a0c79952b8 100644 --- a/test/cases/inherit_want_safety.zig +++ b/test/cases/inherit_want_safety.zig @@ -23,6 +23,13 @@ pub export fn entry() usize { u += 1; }, } + if (@as(error{}!usize, u)) |_| { + u += 1; + } else |e| switch (e) { + else => { + u += 1; + } + } return u; } |
