aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkristopher tate <kt@connectfree.co.jp>2018-07-29 17:19:36 +0900
committerkristopher tate <kt@connectfree.co.jp>2018-08-02 17:03:39 +0900
commitff4a03f35157c3c82d581a599bf98db86504ecc1 (patch)
treef8e677cf07c3f6d5eb47217e0f30d151a192b383 /doc
parent51955a5ca2b6f3f005e28cd3758dc481c2eea0c3 (diff)
downloadzig-ff4a03f35157c3c82d581a599bf98db86504ecc1.tar.gz
zig-ff4a03f35157c3c82d581a599bf98db86504ecc1.zip
doc/langref.html.in: update docs to reflect that the promise symbol is no in scope with suspend;
Tracking Issue #1296 ;
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.html.in12
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 7fde550338..58b63f7f40 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -4690,9 +4690,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();
}
result = true;
}
@@ -4791,9 +4791,9 @@ async fn amain() void {
}
async fn another() i32 {
seq('c');
- suspend |p| {
+ suspend {
seq('d');
- a_promise = p;
+ a_promise = @handle();
}
seq('g');
return 1234;
@@ -7388,7 +7388,7 @@ Defer(body) = ("defer" | "deferror") body
IfExpression(body) = "if" "(" Expression ")" body option("else" BlockExpression(body))
-SuspendExpression(body) = "suspend" option(("|" Symbol "|" body))
+SuspendExpression(body) = "suspend" option( body )
IfErrorExpression(body) = "if" "(" Expression ")" option("|" option("*") Symbol "|") body "else" "|" Symbol "|" BlockExpression(body)