mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
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.
12 lines
333 B
Text
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.
|