Closed
Description
Consider this code:
type MyId =
| IdA of int
| IdB of string
member this.IdA =
match this with
| IdA x -> Some x
| _ -> None
let onlyIdA (ids: MyId list) = ids |> List.choose _.IdA
The last line fails to compile with an error on _.IdA
:
Error FS0812 : The syntax 'expr.id' may only be used with record labels, properties and fields
I would expect this to compile, since IdA
is indeed a property.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done