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

We need superclass constructor call syntax #12

Open
iconmaster5326 opened this issue Feb 14, 2018 · 0 comments
Open

We need superclass constructor call syntax #12

iconmaster5326 opened this issue Feb 14, 2018 · 0 comments

Comments

@iconmaster5326
Copy link
Member

Inside constructors, we need to be able to call superclass constructors. This should use syntax similar to #11.

Proposed syntax:

class a {
    new(int x) {}
}

class b {
    new(string y) {}
}

class c : a,b {
    new() {
        new(42);
    }

    new(int z) {
        // note that we can have statements before super-constructor calls,
        // and said calls are optional, anyways.
        // We'll issue a warning if not all superclasses have their constructors called for certain.
        @super new(z);
        @super(class b) new(z.toString());
    }
}
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

No branches or pull requests

1 participant