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

Analyzer permits initializers on factory constructors #20577

Closed
stereotype441 opened this issue Aug 19, 2014 · 4 comments
Closed

Analyzer permits initializers on factory constructors #20577

stereotype441 opened this issue Aug 19, 2014 · 4 comments
Assignees
Milestone

Comments

@stereotype441
Copy link
Member

The following code is incorrect, because initializers don't make sense on factory constructors. But analyzer accepts it without error:

  class Foo {
    int i;
    Foo();
    factory Foo.factoryConstructor() : i = 1 {
      return new Foo();
    }
  }
  main() {
    print(new Foo.factoryConstructor());
  }

The VM and Dart2js correctly generate an error for this code.

@bwilkerson
Copy link
Member

Removed Priority-Unassigned label.
Added Priority-Medium label.

@bwilkerson
Copy link
Member

Set owner to @bwilkerson.
Added Started label.

@bwilkerson
Copy link
Member

https://codereview.chromium.org/705393002/ (bleeding edge revision 41616)


Added Fixed label.

@clayberg
Copy link

Added this to the 1.8 milestone.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants