-
Notifications
You must be signed in to change notification settings - Fork 832
Closed
Labels
Area-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsFeature Improvement
Milestone
Description
This caught me out today - the error message is not only misleading but shows as an "internal error" in the compiler.
Repro steps
Enter the following code in a script or code file:
type ContactMethod =
| Telephone of telephoneNumber:string
| Address of {| Line1 : string; Line 2 : string; Postcode : string |}Expected behavior
Did you notice the error? There's a space between Line and 2. I would expect the same error as for a "full" record:
error FS0010: Unexpected integer literal in field declaration. Expected ':' or other token
And the red squiggly is directly underneath the 2.
Actual behavior
You get the error internal error: empty tuple type with a red squiggly underneath the entire anonymous record definition. This had me stumped for probably 2 or 3 minutes.
Metadata
Metadata
Assignees
Labels
Area-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsFeature Improvement
Type
Projects
Status
Done