rcl/golden/error/parse_term_needs_paren.test
Ruud van Asseldonk 933712cb8c Add parse error help for certain keywords
Now that full expressions are no longer allowed in some places, the
changelog mentions how to fix it, but we can actually put the help
straight into the code. And then it's helpful in all cases where you
try to use an expression and the keyword would be valid if you added
paretheses.
2024-06-16 23:16:01 +02:00

12 lines
333 B
Text

let valid = [for x in (let ys = [1, 2, 3]; ys): x];
let invalid = [for x in let ys = [1, 2, 3]; ys: x];
invalid
# output:
stdin:2:25
2 │ let invalid = [for x in let ys = [1, 2, 3]; ys: x];
╵ ^~~
Error: Expected a term here.
Help: If this should be an expression, try wrapping it in parentheses.