0609c6dacc
This CL adds predefined constructors to LateInitializationErrorImpl that only take the name of the late field/variable as argument. This can reduce the size of the generated code for ddc/dart2js size because the long message isn't repeated at all call sites. In response to #43995 Change-Id: Ie276dd1455feab1655da3a503856da425b20f04f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169883 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Stephen Adams <sra@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
28 lines
818 B
Plaintext
28 lines
818 B
Plaintext
library /*isNonNullableByDefault*/;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "dart:_internal" as _in;
|
|
|
|
abstract class A extends core::Object {
|
|
field core::int? _#A#x = null;
|
|
field core::bool _#A#x#isSet = false;
|
|
synthetic constructor •() → self::A
|
|
: super core::Object::•()
|
|
;
|
|
get x() → core::int
|
|
return this.{self::A::_#A#x#isSet} ?{core::int} let final core::int? #t1 = this.{self::A::_#A#x} in #t1{core::int} : throw new _in::LateError::fieldNI("x");
|
|
set x(core::int #t2) → void {
|
|
this.{self::A::_#A#x#isSet} = true;
|
|
this.{self::A::_#A#x} = #t2;
|
|
}
|
|
}
|
|
class _B extends core::Object implements self::A {
|
|
field core::int x = 3;
|
|
synthetic constructor •() → self::_B
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
static method main() → dynamic {
|
|
self::A a;
|
|
}
|