Skip to content

better error recovery / invalid syntax around anonymous type and units of measure literal #10629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
smoothdeveloper opened this issue Dec 7, 2020 · 0 comments
Assignees
Labels
Area-Diagnostics mistakes and possible improvements to diagnostics Feature Request
Milestone

Comments

@smoothdeveloper
Copy link
Contributor

type [<Measure>] m
let a = {|a=1<m>|}
//      ^^^^^^^^^^

the tooling has issue here because there is no space before |}.

FS0010: Unexpected symbol '}' in expression

the workaround:

let a = {|a=1<m> |}

I report the issue because it is a bit inconsistent, it works when no unit of measure is involved, and it works for a nominal record type.

maybe the compiler can accept the code or, tells me that the closing of the anonymous record expression needs to be one space appart in this case.

@cartermp cartermp added this to the Backlog milestone Dec 7, 2020
@dsyme dsyme added the Area-Diagnostics mistakes and possible improvements to diagnostics label Apr 20, 2022
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
@edgarfgp edgarfgp self-assigned this May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Diagnostics mistakes and possible improvements to diagnostics Feature Request
Projects
Status: New
Development

No branches or pull requests

4 participants