infer const wherever required inside a const expression #20021
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
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".
The text was updated successfully, but these errors were encountered: