-
Notifications
You must be signed in to change notification settings - Fork 833
Open
Labels
Area-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsFeature ImprovementTheme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
Area-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsFeature ImprovementTheme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Type
Projects
Status
In Progress