Skip to content

Explicit base constructor call not properly called #2425

@ncave

Description

@ncave
type Node =
    val X: int
    new (x: int) = { X = x }

type Leaf =
    inherit Node
    val Y: string
    new (x: int, y: string) =
        { inherit Node(x); Y = y }

[<EntryPoint>]
let main _args =
    let node = Leaf(3, "4")
    let x = node.X  // <-- Error: This should be 3, but is undefined.
    let y = node.Y
    System.Console.WriteLine($"x: {x}, y: {y}")
    0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions