I suggest we ...

Allow lower-case DU cases when [<RequireQualifiedAccess>] is specified

Currently, it is not allowed to declare DU cases with lower-case letters. For instance, this is not allowed:

type Foo =
| foo
| bar
| baz
// etc...

This yields: error FS0053: Discriminated union cases and exception labels must be uppercase identifiers

As I understand it, this is to prevent ambiguity in pattern matching between matching a union case and binding to an identifier. However, this is not an issue if the [<RequireQualifiedAccess>] attribute is specified on the DU. Therefore, I propose we allow lower-case cases in this case.

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Alex Corrado shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

F# Language

Feedback and Knowledge Base