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

Inherit class instance cannot be assigned to the variable of a base class's type. #346

Closed
Kray-G opened this issue Nov 9, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Kray-G
Copy link
Owner

Kray-G commented Nov 9, 2021

class A {
    public x() {}
}
class B:A {
    public y() {}
}

var a:A = new B();
Error: Type mismatch for (a) in assignment (A, B) near the <(unknown)>:8
@Kray-G Kray-G added the enhancement New feature or request label Nov 9, 2021
@Kray-G Kray-G added this to the v1.1.0 milestone Nov 9, 2021
@Kray-G Kray-G self-assigned this Nov 9, 2021
@Kray-G Kray-G closed this as completed in ec71922 Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant