const extensions / constexpr
in Dart
#3722
Labels
feature
Proposed language feature that solves one or more problems
constexpr
in Dart
#3722
Consider a case in which one may want to instantiate a given
const
instance, in different places, a few too times too many:After a (short) while, one may attempt to reach for a short-hand, such as:
This one, however - would no long evaluate at compile time.
Having a:
Which would de-sugar into the usual:
at every invocation inline, would be rather useful indeed. The C++/like
constexpr
were brought up already at #2222, yet I don't see much discussion around it. Low priority as it might be, it wouldn't hurt the language in the slightest.The text was updated successfully, but these errors were encountered: