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

const variables #3549

Closed
gbracha opened this issue Jun 12, 2012 · 2 comments
Closed

const variables #3549

gbracha opened this issue Jun 12, 2012 · 2 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).

Comments

@gbracha
Copy link
Contributor

gbracha commented Jun 12, 2012

A consequence of liberalizing the initialization of static variables has been that final static variables are not reliably constant anymore. Const variables were introduced to compensate for this.

The language spec requires that variables be declared const to be treated as compile time constants, and that final variables not be treated as compile-time constants. See spec sections 5 & 10.1.

I would expect us to pursue a staged approach: first allow const variables, then revise our libraries, then revoke the constant status of static final variables (and then implement lazy initialization).

@gbracha
Copy link
Contributor Author

gbracha commented Jun 12, 2012

Analyzer issue #3550
VM issue #3551
dart2js issue #3552

@anders-sandholm
Copy link
Contributor

Issue #3394 has been merged into this issue.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
None yet
Development

No branches or pull requests

3 participants