Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit base constructor call not properly called #2425

Open
ncave opened this issue Apr 2, 2021 · 0 comments · May be fixed by #2426
Open

Explicit base constructor call not properly called #2425

ncave opened this issue Apr 2, 2021 · 0 comments · May be fixed by #2426

Comments

@ncave
Copy link
Collaborator

ncave commented Apr 2, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants