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

No parsing error for invalid constructor initializer #36262

Closed
scheglov opened this issue Mar 19, 2019 · 1 comment
Closed

No parsing error for invalid constructor initializer #36262

scheglov opened this issue Mar 19, 2019 · 1 comment
Assignees

Comments

@scheglov
Copy link
Contributor

See pkg/front_end/testcases/regress/issue_31198.dart.

abstract class A {}

class B extends A {
  B(): super().foo() {}
}

bad() {
  new B();
}

main() {}

I think super().foo() is not something valid, is it?

@bwilkerson
Copy link
Member

No, it isn't valid. super() can be used to invoke the unnamed constructor from the superclass, but it can't be followed by anything else. super.foo() can be used to invoke a named constructor, but then the parentheses after super are invalid.

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

3 participants