aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/error.zig
diff options
context:
space:
mode:
authorHydroH <iodizon@163.com>2024-03-28 18:23:32 +0800
committerGitHub <noreply@github.com>2024-03-28 10:23:32 +0000
commit7aa42f47b79f289829a1b43a68c8c08e374aa6a2 (patch)
treeb4562be62e7f23bad2ed9429fa6451871b65ff4a /test/behavior/error.zig
parent17053887d080bd125d2f5ccbb39238f23c706328 (diff)
downloadzig-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.zig5
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);
+}