-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).core-ltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
It's common in Flutter code to use enums heavily. Since these are always entirely known at compile time, it is unfortunate that they cannot be used in constant expressions. (Constant expressions with enums would allow us to assert things about arguments based on enums in constant constructors which would allow big performance wins in widget trees which could be constant in principle but can't today because of this issue.)
enum X { a, b }
const bool foo = X.a == X.b; // <-- won't compile
void main() {
print(foo);
}zoechi, jonboj, a14n, fmorgado, bergwerf and 36 more
Metadata
Metadata
Assignees
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).core-ltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug