Skip to content

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

@smoothdeveloper

Description

@smoothdeveloper
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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions