fix code broken from previous commit

This commit is contained in:
Jacob G-W
2021-06-19 21:10:22 -04:00
committed by Andrew Kelley
parent b83b3883ba
commit 9fffffb07b
162 changed files with 720 additions and 148 deletions

View File

@@ -139,7 +139,10 @@ test "comptime test error for empty error set" {
const EmptyErrorSet = error{};
fn testComptimeTestErrorEmptySet(x: EmptyErrorSet!i32) !void {
if (x) |v| try expect(v == 1234) else |err| @compileError("bad");
if (x) |v| try expect(v == 1234) else |err| {
_ = err;
@compileError("bad");
}
}
test "syntax: optional operator in front of error union operator" {
@@ -394,6 +397,7 @@ test "function pointer with return type that is error union with payload which i
const Err = error{UnspecifiedErr};
fn bar(a: i32) anyerror!*Foo {
_ = a;
return Err.UnspecifiedErr;
}
@@ -448,7 +452,9 @@ test "error payload type is correctly resolved" {
test "error union comptime caching" {
const S = struct {
fn foo(comptime arg: anytype) void {}
fn foo(comptime arg: anytype) void {
arg catch {};
}
};
S.foo(@as(anyerror!void, {}));