Closed
Description
Currently constant forwarding constructors are not supported, which seems like an oversight.
For instance:
class S {
final a, b;
const S({this.a, this.b});
}
class M {}
class C extends S with M {
const C() : super(b: 2, a: 1);
}
main() => const C();
const C()
is not allowed since the super constructor (S+M) is not constant. This could be supported if the constness of the S constructor propagated to the forwarding S+M constructor where feasible.