Skip to content

Signature generation roundtrip issue: overloaded member with unit parameter #19596

Description

@T-Gro

Implementation:

module Repro
type R1 = { f1 : int }
type R2 = { f2 : int }
type D() =
    member x.N = x.M { f1 = 3 }
    member x.M((y: R1)) = ()
    member x.M(()) = ()

Actual generated signature:

module Repro

type R1 = { f1: int }
type R2 = { f2: int }
type D =
    new: unit -> D
    member M: unit -> unit
    member M: y: R1 -> unit
    member N: unit

Error on roundtrip compile:

error FS0193: Module requires a value 'member D.M: unit -> unit'

The generated member M: unit -> unit cannot be matched with member x.M(()) = ().

Expected signature:

[<Class>]
type D =
    new: unit -> D
    member M: y: R1 -> unit
    member M: unit -> unit
    member N: unit

Verified: roundtrips successfully (same content, just added [<Class>]).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions