| ... | @@ -6689,7 +6689,7 @@ comptime { | ... | @@ -6689,7 +6689,7 @@ comptime { |
| 6689 | {#header_close#} | 6689 | {#header_close#} |
| 6690 | | 6690 | |
| 6691 | {#header_open|@asyncCall#} | 6691 | {#header_open|@asyncCall#} |
| 6692 | <pre>{#syntax#}@asyncCall(frame_buffer: []align(@alignOf(@Frame(anyAsyncFunction))) u8, result_ptr, function_ptr, args: ...) anyframe->T{#endsyntax#}</pre> | 6692 | <pre>{#syntax#}@asyncCall(frame_buffer: []align(@alignOf(@Frame(anyAsyncFunction))) u8, result_ptr, function_ptr, args: var) anyframe->T{#endsyntax#}</pre> |
| 6693 | <p> | 6693 | <p> |
| 6694 | {#syntax#}@asyncCall{#endsyntax#} performs an {#syntax#}async{#endsyntax#} call on a function pointer, | 6694 | {#syntax#}@asyncCall{#endsyntax#} performs an {#syntax#}async{#endsyntax#} call on a function pointer, |
| 6695 | which may or may not be an {#link|async function|Async Functions#}. | 6695 | which may or may not be an {#link|async function|Async Functions#}. |
| ... | @@ -6716,7 +6716,7 @@ test "async fn pointer in a struct field" { | ... | @@ -6716,7 +6716,7 @@ test "async fn pointer in a struct field" { |
| 6716 | }; | 6716 | }; |
| 6717 | var foo = Foo{ .bar = func }; | 6717 | var foo = Foo{ .bar = func }; |
| 6718 | var bytes: [64]u8 align(@alignOf(@Frame(func))) = undefined; | 6718 | var bytes: [64]u8 align(@alignOf(@Frame(func))) = undefined; |
| 6719 | const f = @asyncCall(&bytes, {}, foo.bar, &data); | 6719 | const f = @asyncCall(&bytes, {}, foo.bar, .{&data}); |
| 6720 | assert(data == 2); | 6720 | assert(data == 2); |
| 6721 | resume f; | 6721 | resume f; |
| 6722 | assert(data == 4); | 6722 | assert(data == 4); |