Commit 3241ada468

kristopher tate <kt@connectfree.co.jp>
2018-07-29 10:17:48
test/cases/coroutines.zig: update test to reflect that the promise symbol is no in scope with suspend;
Tracking Issue #1296 ;
1 parent 79792a3
Changed files (1)
test
test/cases/coroutines.zig
@@ -62,9 +62,9 @@ test "coroutine suspend with block" {
 var a_promise: promise = undefined;
 var result = false;
 async fn testSuspendBlock() void {
-    suspend |p| {
-        comptime assert(@typeOf(p) == promise->void);
-        a_promise = p;
+    suspend {
+        comptime assert(@typeOf(@handle()) == promise->void);
+        a_promise = @handle();
     }
 
     //Test to make sure that @handle() works as advertised (issue #1296)
@@ -98,9 +98,9 @@ async fn await_amain() void {
 }
 async fn await_another() i32 {
     await_seq('c');
-    suspend |p| {
+    suspend {
         await_seq('d');
-        await_a_promise = p;
+        await_a_promise = @handle();
     }
     await_seq('g');
     return 1234;