diff options
| author | HydroH <iodizon@163.com> | 2024-03-28 18:23:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 10:23:32 +0000 |
| commit | 7aa42f47b79f289829a1b43a68c8c08e374aa6a2 (patch) | |
| tree | b4562be62e7f23bad2ed9429fa6451871b65ff4a /test/behavior/error.zig | |
| parent | 17053887d080bd125d2f5ccbb39238f23c706328 (diff) | |
| download | zig-7aa42f47b79f289829a1b43a68c8c08e374aa6a2.tar.gz zig-7aa42f47b79f289829a1b43a68c8c08e374aa6a2.zip | |
allow `@errorcast` to cast error sets to error unions
Diffstat (limited to 'test/behavior/error.zig')
| -rw-r--r-- | test/behavior/error.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/behavior/error.zig b/test/behavior/error.zig index 8e4dd2c091..952d010a14 100644 --- a/test/behavior/error.zig +++ b/test/behavior/error.zig @@ -1039,3 +1039,8 @@ test "errorCast to adhoc inferred error set" { }; try std.testing.expect((try S.baz()) == 1234); } + +test "errorCast from error sets to error unions" { + const err_union: Set1!void = @errorCast(error.A); + try expectError(error.A, err_union); +} |
