aboutsummaryrefslogtreecommitdiff
path: root/test/cases/while.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-02 14:26:14 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-02 14:26:14 -0500
commit39d5f44863aafa77163b2a7e32f2553a589dbb2c (patch)
tree43a0d9684bde2bb94bca491ab3718408dc05c7ed /test/cases/while.zig
parentcfb2c676925d77887e46631dcafa783e6c65e61d (diff)
downloadzig-39d5f44863aafa77163b2a7e32f2553a589dbb2c.tar.gz
zig-39d5f44863aafa77163b2a7e32f2553a589dbb2c.zip
*WI* error sets - basic support working
Diffstat (limited to 'test/cases/while.zig')
-rw-r--r--test/cases/while.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/cases/while.zig b/test/cases/while.zig
index 0b3d2660ed..33d5a5623a 100644
--- a/test/cases/while.zig
+++ b/test/cases/while.zig
@@ -50,7 +50,7 @@ fn runContinueAndBreakTest() void {
test "return with implicit cast from while loop" {
returnWithImplicitCastFromWhileLoopTest() catch unreachable;
}
-fn returnWithImplicitCastFromWhileLoopTest() !void {
+fn returnWithImplicitCastFromWhileLoopTest() error!void {
while (true) {
return;
}
@@ -116,7 +116,7 @@ test "while with error union condition" {
}
var numbers_left: i32 = undefined;
-fn getNumberOrErr() !i32 {
+fn getNumberOrErr() error!i32 {
return if (numbers_left == 0)
error.OutOfNumbers
else x: {
@@ -204,7 +204,7 @@ fn testContinueOuter() void {
fn returnNull() ?i32 { return null; }
fn returnMaybe(x: i32) ?i32 { return x; }
-fn returnError() %i32 { return error.YouWantedAnError; }
-fn returnSuccess(x: i32) %i32 { return x; }
+fn returnError() error!i32 { return error.YouWantedAnError; }
+fn returnSuccess(x: i32) error!i32 { return x; }
fn returnFalse() bool { return false; }
fn returnTrue() bool { return true; }