Skip to content

Regression: DU case at pattern match site no longer requires parameter #9420

@cartermp

Description

@cartermp

The following code compiles and runs, but shouldn't:

type DU = Case of int

let f du =
    match du with
    | Case -> printfn "hello!"

[<EntryPoint>]
let main argv =
    f (Case 1)
    0 // return an integer exit code

Case -> should be a compile error, resolvable by Case _ -> or Case x ->.

This is with latest .NET SDK 3.1.300, and was not the case with 3.1.200.

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