Skip to content

MethodAccessException on equality comparison of a type private to module #17541

@iminashi

Description

@iminashi

Something that has worked previously now fails with a MethodAccessException when using SDK 9.0.100.

Repro steps

Calling a public function that does an equality comparison on a type that is private to the module.

module Module =
    type private DU = ABC | YYZ

    let publicFunction () : bool =
        ABC = YYZ

Module.publicFunction () |> printfn "%b"

Expected behavior

false is printed.

Actual behavior

Unhandled exception. System.MethodAccessException: Attempt by method 'Program+Module.publicFunction()' to access method 'Program+Module+DU.Equals(DU, System.Collections.IEqualityComparer)' failed.

Related information

  • 9.0.100-preview.7.24407.12

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions