Skip to content

Explicit base constructor call not properly called #2425

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

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions