Open courajs opened 4 years ago
Ah - I ran this against master and now get a compile error. Has async fn type syntax been removed?
🚀 generators$ /Users/aaron/Downloads/zig-macos-x86_64-0.6.0+c6764fd25/zig build run
./src/main.zig:104:98: error: invalid token: ')'
fn thing(target: *RunningGenerator(u8,u8,u8), yield: async fn(*RunningGenerator(u8,u8,u8), u8) u8) u8 {
^
generators...The following command exited with error code 1:
/Users/aaron/Downloads/zig-macos-x86_64-0.6.0+c6764fd25/zig build-exe /Users/aaron/dev/zig/generators/src/main.zig --cache-dir /Users/aaron/dev/zig/generators/zig-cache --name generators --cache on
Build failed. The following command failed:
/Users/aaron/dev/zig/generators/zig-cache/o/cU0PoSBcKL1sr6QtX5H4agcHEObF6D5SjwC5esYol3WK9_1FKLHWZni1yXbTaZD0/build /Users/aaron/Downloads/zig-macos-x86_64-0.6.0+c6764fd25/zig /Users/aaron/dev/zig/generators /Users/aaron/dev/zig/generators/zig-cache run
async fn() void
was changed to fn() callconv(.Async) void
.
Ah... yes (https://github.com/ziglang/zig/pull/5253). Updated the gist to use callconv, and now get the same broken module on master.
Sorry for the large example, I had trouble reducing it: https://gist.github.com/courajs/7815091c46d94cb9585f25832da4487c
If you change lines 106 & 108 to store the return of
@asyncCall
in a variable, it works as expected:->