DartPad & IntelliJ Dart 2.2.0:
X.u(): error Evaluation of this constant expression throws an exception.
const X a = X.u();
class X {
final double a;
const X._(this.a) : assert(a == 1.0);
const X.u() : this._(null);
}
The error goes away when the assertion is removed.
Thanks, well, this does definitely make sense.
I would expect a more descriptive error message like that an assertion has failed.
The redirecting constructor and just a … throws an exception. threw me off here.
I hope this can be of use to someone searching for the same error.