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

overridden fields not properly handled in generated code #230

Closed
vsmenon opened this issue Jun 17, 2015 · 2 comments
Closed

overridden fields not properly handled in generated code #230

vsmenon opened this issue Jun 17, 2015 · 2 comments

Comments

@vsmenon
Copy link
Contributor

vsmenon commented Jun 17, 2015

On the VM, this prints "hello\nworld". On DDC, "hello\n\hello". In the generated code, A's constructor is overwriting the value written by B's constructor.

class A {
  var x = "hello";
  void show() => print(x);
}

class B extends A {
  var x = "world";
}

var b = new B();
var a = new A();

void main() {
  a.show();
  b.show();
}
@vsmenon
Copy link
Contributor Author

vsmenon commented Jun 17, 2015

We've also discussed forbidding field overrides. That's the other way we can go with this.

@jmesserly
Copy link
Contributor

this is a dupe of #52 right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants