diff options
| author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2022-03-01 17:09:03 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-03 15:07:23 -0500 |
| commit | 7deadf4301d5f5f5e2b8a1a8b2dc7109e2c82181 (patch) | |
| tree | 9ceee5649ba2b889e2fb8cce3ca08e4b1192e10d /test/behavior/type.zig | |
| parent | 65943010c70b33e711a038dff5f80066045ee1b7 (diff) | |
| download | zig-7deadf4301d5f5f5e2b8a1a8b2dc7109e2c82181.tar.gz zig-7deadf4301d5f5f5e2b8a1a8b2dc7109e2c82181.zip | |
stage2: reify error sets
Diffstat (limited to 'test/behavior/type.zig')
| -rw-r--r-- | test/behavior/type.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/behavior/type.zig b/test/behavior/type.zig index eea4d7d203..43751ff4b7 100644 --- a/test/behavior/type.zig +++ b/test/behavior/type.zig @@ -240,12 +240,19 @@ fn add(a: i32, b: i32) i32 { } test "Type.ErrorSet" { - if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO + try testing.expect(@Type(TypeInfo{ .ErrorSet = null }) == anyerror); // error sets don't compare equal so just check if they compile _ = @Type(@typeInfo(error{})); _ = @Type(@typeInfo(error{A})); _ = @Type(@typeInfo(error{ A, B, C })); + _ = @Type(TypeInfo{ + .ErrorSet = &[_]TypeInfo.Error{ + .{ .name = "A" }, + .{ .name = "B" }, + .{ .name = "C" }, + }, + }); } test "Type.Struct" { |
