Skip to content

Compiler crashes on a specific anonymous record use case #6479

Description

@vasily-kirichenko

https://github.com/vasily-kirichenko/AnonRecords2

In a library project:

module AnonRecords.M

type AR = {| I: int; S: string |}

let getAR () = {| I = 1; S = "" |}

type R = { F: float; AR: AR }

let getR () = { F = 1.0; AR = getAR() }

In a console project:

[<EntryPoint>]
let main _ =
    let f (_: AnonRecords.M.AR) = ()

    // Commenting this line results with the compiler crashing with:
    // Error the anonymous record <>f__AnonymousType611736317`2' has not been generated in the pre-phase of generating this module	ConsoleApp	C:\WLCR\github\AnonRecords\ConsoleApp\error FS0192	1	
    f (AnonRecords.M.getAR()) 

    let ar: AnonRecords.M.AR = {| I = 1; S = "" |}
    f ar

    f (AnonRecords.M.getR().AR)

    0

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions