What
The following code results in an error message which could be improved upon: -
let x =
query {
for i in [|1;2;3|]
where (i<2)
select i
}
The error is: -
error FS0010: Unexpected identifier in expression. Expected '->' or other token.
Why
The for-in-do-syntax (for i in [|1;2;3|] do) differs from other languages, and do is kind of non-intuitive here, so it is easy to forget. Also the error message is very cryptic and underlines the next statement (here where) so the developer tries to seek the problem from wrong place.
How
A better error might be something that would mention what is the actual problem here, that you need the do-keyword.
Related to #1103
What
The following code results in an error message which could be improved upon: -
The error is: -
error FS0010: Unexpected identifier in expression. Expected '->' or other token.Why
The for-in-do-syntax (
for i in [|1;2;3|] do) differs from other languages, anddois kind of non-intuitive here, so it is easy to forget. Also the error message is very cryptic and underlines the next statement (herewhere) so the developer tries to seek the problem from wrong place.How
A better error might be something that would mention what is the actual problem here, that you need the do-keyword.
Related to #1103