F# - A period in a union case name

Viewed 108

I want to have a union case name like the following

type PrimaryDiagnosisSite =
    | ``C00.0 - External upper lip``

Unfortunately, the compiler complains about the period in the name:

Invalid namespace, module, type or union case name

I'd like to keep the period in the union case name, if possible. The compiler doesn't like when I try to escape the period via backslash.

Is this possible?

1 Answers

Not possible, it seems.

From the F# language spec, section 3.4:

Note that when an identifier is used for the name of a types, union type case, module, or namespace, the following characters are not allowed even inside double-backtick marks: ā€˜.', '+', '$', '&', '[', ']', '/', '\', '*', '"', '`'

Related