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

Nested functions are not immutable #19129

Closed
floitschG opened this issue Jun 2, 2014 · 2 comments
Closed

Nested functions are not immutable #19129

floitschG opened this issue Jun 2, 2014 · 2 comments
Assignees

Comments

@floitschG
Copy link
Contributor

dart2js does not catch that nested functions are immutable.

The following program "works":
===
main() {
  foo() {
    foo = () => 499;
    print(foo());
  }
  foo();
}
===

For more complicated programs the compiler crashes.

@sigmundch
Copy link
Member

Just sent out a possible fix in https://codereview.chromium.org/1073983003/, but I'm not sure if it is the approach you want to use here.

I'm basically marking the element of named local functions as final, so no setter is available.

@sigmundch
Copy link
Member

fixed in r45123


Added Fixed label.

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

4 participants