Do we no longer support return
in when branches?
── MISSING EXPRESSION in ./examples/DesugaringTry/main.roc ─────────────────────
I am partway through parsing a when expression, but I got stuck here:
21│ when Str.split_first(str, " was born in ") is
22│ Err(err1) -> return Err(err)
^
I was expecting to see an expression like 42 or "hello".
That is definitely a bug
But that's interesting, it's in the parser
It was fixed when I moved the return to the next line
I think I vaguely remember @Joshua Warner and @Sam Mohr talking about a parser change related to indentation with return?
I made #7545 for this
I'll try to take that on once we get the release out
Or at least once I'm down updating tutorial/homepage
We never did support it in the first place
But we should add support yes
Sam Mohr said:
We never did support it in the first place
It does work :p (as long as it's not all on the same line)
Yeah exactly
Many people have been confused by it
Should be a fairly straight forward change: moving return from being parsed only as a stmt to being an expr (same place if is parsed)
Last updated: Jul 06 2025 at 12:14 UTC