Improve error reporting: do-keyword missing in a query #2799
Labels
Area-Diagnostics
mistakes and possible improvements to diagnostics
Feature Improvement
Theme-Simple-F#
A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Milestone
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, anddo
is 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
The text was updated successfully, but these errors were encountered: