Make methods extracted from const objects be const values. #12531
Labels
area-language
New language issues should be filed at https://github.com/dart-lang/language
closed-not-planned
Closed as we don't intend to take action on the reported issue
type-enhancement
A request for a change that isn't a bug
Currently top-level and static functions are compile-time constant values.
Would it be possible to also make methods extracted from a const value be const?
That is:
class C {
final int x;
const C(this.x);
int value() => x;
}
typedef int Foo();
const Foo = const C().value;
Since "const C()" is a compile-time constant, the behavior of its value method should also be determinable at compile time.
The text was updated successfully, but these errors were encountered: