master
1const std = @import("std");
2const expect = std.testing.expect;
3
4test "coercion to error unions" {
5 const x: anyerror!i32 = 1234;
6 const y: anyerror!i32 = error.Failure;
7
8 try expect((try x) == 1234);
9 try std.testing.expectError(error.Failure, y);
10}
11
12// test