Skip to content

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

@baronfel

Description

@baronfel

Submitted by Alex Corrado on 8/24/2016 12:00:00 AM
1 votes on UserVoice prior to migration

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.

RFC: https://github.com/fsharp/fslang-design/blob/main/FSharp-7.0/FS-1126-allow-lower-case-du-cases%20when-require-qualified-access-is%20specified.md

Original UserVoice Submission
Archived Uservoice Comments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions