Skip to content

dart2js: implement correct setter semantics #5068

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

Closed
lrhn opened this issue Sep 11, 2012 · 5 comments
Closed

dart2js: implement correct setter semantics #5068

lrhn opened this issue Sep 11, 2012 · 5 comments
Labels
closed-duplicate Closed in favor of an existing report web-dart2js
Milestone

Comments

@lrhn
Copy link
Member

lrhn commented Sep 11, 2012

The specification gives setters a separate name from getters, and name lookup of one does not interact with the other.

We currently assume that a getter (e.g., a final field) on a class introduces a "property", and that writing to the name fails due to a missing corresponding setter.

Instead writing to the name should skip the getter declaration completely and look further out for a setter for the name.

example:

set x(v) { print("OK"); };
class A {
  static final x = 42;
  static foo() { x = 10; }
}
main() => A.foo();

This program should print "OK" according to the specification. It currently reports that x is not assignable because the 'x' in the assignment is matched with the 'x' declaration in the class, and not the 'x setter' in the top scope.

@kasperl
Copy link

kasperl commented Sep 11, 2012

cc @larsbak.
Changed the title to: "dart2js: implement correct setter semantics".

@kasperl
Copy link

kasperl commented Oct 8, 2012

Removed this from the M1 milestone.
Added this to the M2 milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Removed this from the M2 milestone.

@kasperl
Copy link

kasperl commented Oct 17, 2012

Added this to the M2 milestone.

@peter-ahe-google
Copy link
Contributor

Added Duplicate label.
Marked as being merged into #4870.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants