-
-
Save emekoi/4d12b6ea14d30a291716e53057b458b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
// outputs: | |
// from foo | |
// from bar | |
fn foo() void { | |
suspend { | |
_ = bar(@frame()); | |
} | |
std.debug.warn("from foo\n"); | |
} | |
fn bar(frame: anyframe) void { | |
resume frame; | |
std.debug.warn("from bar\n"); | |
} | |
test "test" { | |
_ = async foo(); | |
} |
andrewrk
commented
Oct 23, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment