Indexing into a constant list should be a constant expression. #8885
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
The minimal repro for the issue is:
Given that the list and the index are both constants, it seems reasonable that it should be a valid constant expression. But currently this gives an error.
I know I can (and will for now) rely on canonicalization to get around this, but it's particularly egregious in my real-world example:
Here, it would be tedious and error-prone to repeat all of the fields for NONE, FASTEST, SMALLEST, and DEFAULT.
The text was updated successfully, but these errors were encountered: