Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Field initializers not run in presence of initializing constructor params #213

Open
@ochafik

Description

@ochafik
class Bar {
  Bar() {
    print("Bar created");
  }
}
class Foo {
  var bar = new Bar();
  Foo([this.bar]);
}
main() {
  print(new Foo().bar);
}

Dart prints:

Bar created
null

But ddc just does not create the unused Bar instance at all.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions