Skip to content

infer const wherever required inside a const expression #20021

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
DartBot opened this issue Jul 13, 2014 · 3 comments
Closed

infer const wherever required inside a const expression #20021

DartBot opened this issue Jul 13, 2014 · 3 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jul 13, 2014

This issue was originally filed by [email protected]


Const expressions have a lot of boilerplate:

    themes: const {
      "Default": const Theme(const {LoginForm: const _LoginForm("pure-form")}),
      "Stacked": const Theme(const {LoginForm: const _LoginForm("pure-form pure-form-stacked")})
    },

It seems like inside any const expression, Dart should infer "const" wherever it can, at least for map and list literals, and ideally for objects as well.

If I leave out "const" for the map literals, the error is:

"Arguments of a constant creation must be constant expressions".

@DartBot
Copy link
Author

DartBot commented Jul 14, 2014

This comment was originally written by @seaneagan


dupe of issue #4046 / issue #18241

@sethladd
Copy link
Contributor

Added Area-Language, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Jul 15, 2014

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

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Jul 15, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
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). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants