I'm a bit confused why
run2 =
res <- await Stdin.line
_ <- await Stdout.line res
run2
is not allowed. I know simple self-reference in eagerly evaluated languages doesn't work, but here the evaluation should only happen once the closure after Stdin.line
gets called? This is resolvable by giving run2
an empty argument, but feels kind of strange.
Yeah, I think that might just be an oversight. We do a syntactic check to see if something looks like a function, and if not and it's self-recursive, you get that error
But in this case this is fine
@Gabriel Pickl can you open an issue for this?
sure
as a detail though: writing this without the backpassing syntactic sugar seems to result in the same error
https://github.com/roc-lang/roc/issues/4291
yep, that makes sense! Backpassing is just syntax sugar, and this error happens after desugaring
Last updated: Jul 05 2025 at 12:14 UTC