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
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Alex CorradoAlex Corrado shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      F# Language

      Feedback and Knowledge Base