[cfe] Change late lowering to handle unsound null values

Change-Id: I91d3f0ee4350816ee4e80713b4d975085f8b3915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163345
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther 2020-09-21 10:15:46 +00:00 committed by commit-bot@chromium.org
parent 46903413bc
commit 0ab7d791a6
78 changed files with 2813 additions and 855 deletions

View file

@ -10,6 +10,8 @@ import 'package:kernel/ast.dart' hide MapEntry;
import 'package:kernel/core_types.dart';
import 'package:kernel/src/legacy_erasure.dart';
import '../../base/nnbd_mode.dart';
import '../constant_context.dart' show ConstantContext;
import '../fasta_codes.dart' show messageInternalProblemAlreadyInitialized;
@ -122,6 +124,9 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
Procedure setterReferenceFrom)
: super(libraryBuilder, charOffset) {
Uri fileUri = libraryBuilder?.fileUri;
// If in mixed mode, late lowerings cannot use `null` as a sentinel on
// non-nullable fields since they can be assigned from legacy code.
bool forceUseIsSetField = libraryBuilder.loader.nnbdMode != NnbdMode.Strong;
if (isAbstract || isExternal) {
_fieldEncoding = new AbstractOrExternalFieldEncoding(fileUri, charOffset,
charEndOffset, getterReferenceFrom, setterReferenceFrom,
@ -143,7 +148,8 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
} else {
_fieldEncoding = new LateFieldWithInitializerEncoding(
name,
@ -154,7 +160,8 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
}
} else {
if (isFinal) {
@ -167,7 +174,8 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
} else {
_fieldEncoding = new LateFieldWithoutInitializerEncoding(
name,
@ -178,7 +186,8 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
}
}
} else if (libraryBuilder.isNonNullableByDefault &&
@ -196,7 +205,8 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
} else {
_fieldEncoding = new LateFieldWithInitializerEncoding(
name,
@ -207,7 +217,8 @@ class SourceFieldBuilder extends MemberBuilderImpl implements FieldBuilder {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
}
} else {
assert(lateIsSetReferenceFrom == null);
@ -714,11 +725,21 @@ abstract class AbstractLateFieldEncoding implements FieldEncoding {
Procedure _lateGetter;
Procedure _lateSetter;
// If `true`, an isSet field is used even when the type of the field is
// not potentially nullable.
//
// This is used to force use isSet fields in mixed mode encoding since
// we cannot trust non-nullable fields to be initialized with non-null values.
bool _forceUseIsSetField;
// If `true`, the is-set field was register before the type was known to be
// nullable or non-nullable. In this case we do not try to remove it from
// the generated AST to avoid inconsistency between the class hierarchy used
// during and after inference.
bool _forceIncludeIsSetField = false;
//
// This is also used to force use isSet fields in mixed mode encoding since
// we cannot trust non-nullable fields to be initialized with non-null values.
bool _forceIncludeIsSetField;
AbstractLateFieldEncoding(
this.name,
@ -729,8 +750,11 @@ abstract class AbstractLateFieldEncoding implements FieldEncoding {
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
bool isCovariant)
: fileOffset = charOffset {
bool isCovariant,
bool forceUseIsSetField)
: fileOffset = charOffset,
_forceUseIsSetField = forceUseIsSetField,
_forceIncludeIsSetField = forceUseIsSetField {
_field =
new Field(null, fileUri: fileUri, reference: referenceFrom?.reference)
..fileOffset = charOffset
@ -1048,7 +1072,8 @@ mixin NonFinalLate on AbstractLateFieldEncoding {
createVariableWrite: (Expression value) =>
_createFieldSet(_field, value),
createIsSetWrite: (Expression value) =>
_createFieldSet(_lateIsSetField, value));
_createFieldSet(_lateIsSetField, value),
useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@ -1060,7 +1085,8 @@ mixin LateWithoutInitializer on AbstractLateFieldEncoding {
return late_lowering.createGetterBodyWithoutInitializer(
coreTypes, fileOffset, name, type, 'Field',
createVariableRead: _createFieldRead,
createIsSetRead: () => _createFieldGet(_lateIsSetField));
createIsSetRead: () => _createFieldGet(_lateIsSetField),
useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@ -1075,7 +1101,8 @@ class LateFieldWithoutInitializerEncoding extends AbstractLateFieldEncoding
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
bool isCovariant)
bool isCovariant,
bool forceUseIsSetField)
: super(
name,
fileUri,
@ -1085,7 +1112,8 @@ class LateFieldWithoutInitializerEncoding extends AbstractLateFieldEncoding
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
}
class LateFieldWithInitializerEncoding extends AbstractLateFieldEncoding
@ -1099,7 +1127,8 @@ class LateFieldWithInitializerEncoding extends AbstractLateFieldEncoding
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
bool isCovariant)
bool isCovariant,
bool forceUseIsSetField)
: super(
name,
fileUri,
@ -1109,7 +1138,8 @@ class LateFieldWithInitializerEncoding extends AbstractLateFieldEncoding
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
@override
Statement _createGetterBody(
@ -1122,7 +1152,8 @@ class LateFieldWithInitializerEncoding extends AbstractLateFieldEncoding
_createFieldSet(_field, value),
createIsSetRead: () => _createFieldGet(_lateIsSetField),
createIsSetWrite: (Expression value) =>
_createFieldSet(_lateIsSetField, value));
_createFieldSet(_lateIsSetField, value),
useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@ -1137,7 +1168,8 @@ class LateFinalFieldWithoutInitializerEncoding extends AbstractLateFieldEncoding
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
bool isCovariant)
bool isCovariant,
bool forceUseIsSetField)
: super(
name,
fileUri,
@ -1147,7 +1179,8 @@ class LateFinalFieldWithoutInitializerEncoding extends AbstractLateFieldEncoding
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
@override
Statement _createSetterBody(
@ -1161,7 +1194,8 @@ class LateFinalFieldWithoutInitializerEncoding extends AbstractLateFieldEncoding
_createFieldSet(_field, value),
createIsSetRead: () => _createFieldGet(_lateIsSetField),
createIsSetWrite: (Expression value) =>
_createFieldSet(_lateIsSetField, value));
_createFieldSet(_lateIsSetField, value),
useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@ -1175,7 +1209,8 @@ class LateFinalFieldWithInitializerEncoding extends AbstractLateFieldEncoding {
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
bool isCovariant)
bool isCovariant,
bool forceUseIsSetField)
: super(
name,
fileUri,
@ -1185,7 +1220,8 @@ class LateFinalFieldWithInitializerEncoding extends AbstractLateFieldEncoding {
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
isCovariant);
isCovariant,
forceUseIsSetField);
@override
Statement _createGetterBody(
CoreTypes coreTypes, String name, Expression initializer) {

View file

@ -15,6 +15,7 @@ import '../../base/instrumentation.dart'
InstrumentationValueForMember,
InstrumentationValueForType,
InstrumentationValueForTypeArgs;
import '../../base/nnbd_mode.dart';
import '../fasta_codes.dart';
import '../names.dart';
import '../problems.dart' show unhandled;
@ -5634,7 +5635,11 @@ class InferenceVisitor
result.add(node);
VariableDeclaration isSetVariable;
if (node.type.isPotentiallyNullable) {
if (node.type.isPotentiallyNullable ||
// We cannot trust that non-nullable locals are not initialized to
// `null` in mixed mode, so we use an `isSet` variable here.
(inferrer.isNonNullableByDefault &&
inferrer.nnbdMode != NnbdMode.Strong)) {
isSetVariable = new VariableDeclaration(
'${late_lowering.lateLocalPrefix}'
'${node.name}'
@ -5676,7 +5681,8 @@ class InferenceVisitor
node.type,
'Local',
createVariableRead: createVariableRead,
createIsSetRead: createIsSetRead)
createIsSetRead: createIsSetRead,
useIsSetField: isSetVariable != null)
: late_lowering.createGetterWithInitializer(
inferrer.coreTypes,
fileOffset,
@ -5686,7 +5692,8 @@ class InferenceVisitor
createVariableRead: createVariableRead,
createVariableWrite: createVariableWrite,
createIsSetRead: createIsSetRead,
createIsSetWrite: createIsSetWrite),
createIsSetWrite: createIsSetWrite,
useIsSetField: isSetVariable != null),
returnType: node.type))
..fileOffset = fileOffset;
getVariable.type =
@ -5720,12 +5727,14 @@ class InferenceVisitor
createVariableRead: createVariableRead,
createVariableWrite: createVariableWrite,
createIsSetRead: createIsSetRead,
createIsSetWrite: createIsSetWrite)
createIsSetWrite: createIsSetWrite,
useIsSetField: isSetVariable != null)
: late_lowering.createSetterBody(inferrer.coreTypes,
fileOffset, node.name, setterParameter, node.type,
shouldReturnValue: true,
createVariableWrite: createVariableWrite,
createIsSetWrite: createIsSetWrite)
createIsSetWrite: createIsSetWrite,
useIsSetField: isSetVariable != null)
..fileOffset = fileOffset,
positionalParameters: <VariableDeclaration>[
setterParameter

View file

@ -26,8 +26,10 @@ Statement createGetterWithInitializer(CoreTypes coreTypes, int fileOffset,
{Expression createVariableRead({bool needsPromotion}),
Expression createVariableWrite(Expression value),
Expression createIsSetRead(),
Expression createIsSetWrite(Expression value)}) {
if (type.isPotentiallyNullable) {
Expression createIsSetWrite(Expression value),
bool useIsSetField}) {
assert(useIsSetField != null);
if (useIsSetField) {
// Generate:
//
// if (!_#isSet#field) {
@ -213,7 +215,9 @@ Statement createGetterWithInitializerWithRecheck(
Statement createGetterBodyWithoutInitializer(CoreTypes coreTypes,
int fileOffset, String name, DartType type, String variableKindName,
{Expression createVariableRead({bool needsPromotion}),
Expression createIsSetRead()}) {
Expression createIsSetRead(),
bool useIsSetField}) {
assert(useIsSetField != null);
Expression exception = new Throw(new ConstructorInvocation(
coreTypes.lateInitializationErrorConstructor,
new Arguments(<Expression>[
@ -224,7 +228,7 @@ Statement createGetterBodyWithoutInitializer(CoreTypes coreTypes,
..fileOffset = fileOffset)
..fileOffset = fileOffset)
..fileOffset = fileOffset;
if (type.isPotentiallyNullable) {
if (useIsSetField) {
// Generate:
//
// return _#isSet#field ? _#field : throw '...';
@ -272,7 +276,9 @@ Statement createSetterBody(CoreTypes coreTypes, int fileOffset, String name,
VariableDeclaration parameter, DartType type,
{bool shouldReturnValue,
Expression createVariableWrite(Expression value),
Expression createIsSetWrite(Expression value)}) {
Expression createIsSetWrite(Expression value),
bool useIsSetField}) {
assert(useIsSetField != null);
Statement createReturn(Expression value) {
if (shouldReturnValue) {
return new ReturnStatement(value)..fileOffset = fileOffset;
@ -285,7 +291,7 @@ Statement createSetterBody(CoreTypes coreTypes, int fileOffset, String name,
createVariableWrite(new VariableGet(parameter)..fileOffset = fileOffset)
..fileOffset = fileOffset);
if (type.isPotentiallyNullable) {
if (useIsSetField) {
// Generate:
//
// _#isSet#field = true;
@ -321,7 +327,9 @@ Statement createSetterBodyFinal(
Expression createVariableRead(),
Expression createVariableWrite(Expression value),
Expression createIsSetRead(),
Expression createIsSetWrite(Expression value)}) {
Expression createIsSetWrite(Expression value),
bool useIsSetField}) {
assert(useIsSetField != null);
Expression exception = new Throw(new ConstructorInvocation(
coreTypes.lateInitializationErrorConstructor,
new Arguments(<Expression>[
@ -341,7 +349,7 @@ Statement createSetterBodyFinal(
}
}
if (type.isPotentiallyNullable) {
if (useIsSetField) {
// Generate:
//
// if (_#isSet#field) {

View file

@ -5,10 +5,12 @@
/*member: _#topLevelNonNullableWithoutInitializer:lateField*/
/*member: topLevelNonNullableWithoutInitializer:lateFieldGetter*/
/*member: topLevelNonNullableWithoutInitializer=:lateFieldSetter*/
/*member: _#topLevelNonNullableWithoutInitializer#isSet:lateIsSetField*/
late int topLevelNonNullableWithoutInitializer;
/*member: _#finalTopLevelNonNullableWithoutInitializer:lateField*/
/*member: finalTopLevelNonNullableWithoutInitializer:lateFieldGetter*/
/*member: finalTopLevelNonNullableWithoutInitializer=:lateFieldSetter*/
/*member: _#finalTopLevelNonNullableWithoutInitializer#isSet:lateIsSetField*/
late final int finalTopLevelNonNullableWithoutInitializer;
/*member: _#topLevelNullableWithoutInitializer:lateField*/
/*member: _#topLevelNullableWithoutInitializer#isSet:lateIsSetField*/
@ -23,9 +25,11 @@ late final int? finalTopLevelNullableWithoutInitializer;
/*member: _#topLevelNonNullableWithInitializer:lateField*/
/*member: topLevelNonNullableWithInitializer:lateFieldGetter*/
/*member: topLevelNonNullableWithInitializer=:lateFieldSetter*/
/*member: _#topLevelNonNullableWithInitializer#isSet:lateIsSetField*/
late int topLevelNonNullableWithInitializer = 0;
/*member: _#finalTopLevelNonNullableWithInitializer:lateField*/
/*member: finalTopLevelNonNullableWithInitializer:lateFieldGetter*/
/*member: _#finalTopLevelNonNullableWithInitializer#isSet:lateIsSetField*/
late final int finalTopLevelNonNullableWithInitializer = 0;
/*member: _#topLevelNullableWithInitializer:lateField*/
/*member: _#topLevelNullableWithInitializer#isSet:lateIsSetField*/
@ -38,10 +42,12 @@ late int? topLevelNullableWithInitializer = 0;
late final int? finalTopLevelNullableWithInitializer = 0;
class Class {
/*member: Class._#Class#instanceNonNullableWithoutInitializer#isSet:lateIsSetField*/
/*member: Class._#Class#instanceNonNullableWithoutInitializer:lateField*/
/*member: Class.instanceNonNullableWithoutInitializer:lateFieldGetter*/
/*member: Class.instanceNonNullableWithoutInitializer=:lateFieldSetter*/
late int instanceNonNullableWithoutInitializer;
/*member: Class._#Class#finalInstanceNonNullableWithoutInitializer#isSet:lateIsSetField*/
/*member: Class._#Class#finalInstanceNonNullableWithoutInitializer:lateField*/
/*member: Class.finalInstanceNonNullableWithoutInitializer:lateFieldGetter*/
/*member: Class.finalInstanceNonNullableWithoutInitializer=:lateFieldSetter*/
@ -56,10 +62,12 @@ class Class {
/*member: Class.finalInstanceNullableWithoutInitializer:lateFieldGetter*/
/*member: Class.finalInstanceNullableWithoutInitializer=:lateFieldSetter*/
late final int? finalInstanceNullableWithoutInitializer;
/*member: Class._#Class#instanceNonNullableWithInitializer#isSet:lateIsSetField*/
/*member: Class._#Class#instanceNonNullableWithInitializer:lateField*/
/*member: Class.instanceNonNullableWithInitializer:lateFieldGetter*/
/*member: Class.instanceNonNullableWithInitializer=:lateFieldSetter*/
late int instanceNonNullableWithInitializer = 0;
/*member: Class._#Class#finalInstanceNonNullableWithInitializer#isSet:lateIsSetField*/
/*member: Class._#Class#finalInstanceNonNullableWithInitializer:lateField*/
/*member: Class.finalInstanceNonNullableWithInitializer:lateFieldGetter*/
late final int finalInstanceNonNullableWithInitializer = 0;
@ -73,10 +81,12 @@ class Class {
/*member: Class.finalInstanceNullableWithInitializer:lateFieldGetter*/
late final int? finalInstanceNullableWithInitializer = 0;
/*member: Class._#staticNonNullableWithoutInitializer#isSet:lateIsSetField*/
/*member: Class._#staticNonNullableWithoutInitializer:lateField*/
/*member: Class.staticNonNullableWithoutInitializer:lateFieldGetter*/
/*member: Class.staticNonNullableWithoutInitializer=:lateFieldSetter*/
static late int staticNonNullableWithoutInitializer;
/*member: Class._#finalStaticNonNullableWithoutInitializer#isSet:lateIsSetField*/
/*member: Class._#finalStaticNonNullableWithoutInitializer:lateField*/
/*member: Class.finalStaticNonNullableWithoutInitializer:lateFieldGetter*/
/*member: Class.finalStaticNonNullableWithoutInitializer=:lateFieldSetter*/
@ -91,10 +101,12 @@ class Class {
/*member: Class.finalStaticNullableWithoutInitializer:lateFieldGetter*/
/*member: Class.finalStaticNullableWithoutInitializer=:lateFieldSetter*/
static late final int? finalStaticNullableWithoutInitializer;
/*member: Class._#staticNonNullableWithInitializer#isSet:lateIsSetField*/
/*member: Class._#staticNonNullableWithInitializer:lateField*/
/*member: Class.staticNonNullableWithInitializer:lateFieldGetter*/
/*member: Class.staticNonNullableWithInitializer=:lateFieldSetter*/
static late int staticNonNullableWithInitializer = 0;
/*member: Class._#finalStaticNonNullableWithInitializer#isSet:lateIsSetField*/
/*member: Class._#finalStaticNonNullableWithInitializer:lateField*/
/*member: Class.finalStaticNonNullableWithInitializer:lateFieldGetter*/
static late final int finalStaticNonNullableWithInitializer = 0;

View file

@ -12,33 +12,47 @@ import "dart:_internal" as _in;
static method main() → dynamic {
core::int? local1;
core::bool #local1#isSet = false;
function #local1#get() → core::int
return let final core::int? #t1 = local1 in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.") : #t1{core::int};
function #local1#set(core::int #t2) → dynamic
return local1 = #t2;
return #local1#isSet ?{core::int} local1{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
function #local1#set(core::int #t1) → dynamic {
#local1#isSet = true;
return local1 = #t1;
}
#local1#set.call(0);
self::expect(0, #local1#get.call());
#local1#set.call(#local1#get.call().{core::num::+}(2));
self::expect(2, #local1#get.call());
core::int? local2;
function #local2#get() → core::int
return let final core::int? #t3 = local2 in #t3.==(null) ?{core::int} local2 = 1 : #t3{core::int};
function #local2#set(core::int #t4) → dynamic
return local2 = #t4;
core::bool #local2#isSet = false;
function #local2#get() → core::int {
if(!#local2#isSet) {
local2 = 1;
#local2#isSet = true;
}
return local2{core::int};
}
function #local2#set(core::int #t2) → dynamic {
#local2#isSet = true;
return local2 = #t2;
}
self::expect(1, #local2#get.call());
#local2#set.call(#local2#get.call().{core::num::+}(2));
self::expect(3, #local2#get.call());
}
static method error() → dynamic {
final core::int? local;
core::bool #local#isSet = false;
function #local#get() → core::int
return let final core::int? #t5 = local in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.") : #t5{core::int};
function #local#set(core::int #t6) → dynamic
if(local.==(null))
return local = #t6;
else
return #local#isSet ?{core::int} local{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.");
function #local#set(core::int #t3) → dynamic
if(#local#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local' has already been initialized.");
#local#set.call((let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/compound.dart:20:3: Error: Non-nullable late variable 'local' without initializer is definitely unassigned.
else {
#local#isSet = true;
return local = #t3;
}
#local#set.call((let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/late_lowering/compound.dart:20:3: Error: Non-nullable late variable 'local' without initializer is definitely unassigned.
local += 0;
^^^^^" in #local#get.call()).{core::num::+}(0));
}

View file

@ -12,33 +12,47 @@ import "dart:_internal" as _in;
static method main() → dynamic {
core::int? local1;
core::bool #local1#isSet = false;
function #local1#get() → core::int
return let final core::int? #t1 = local1 in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.") : #t1{core::int};
function #local1#set(core::int #t2) → dynamic
return local1 = #t2;
return #local1#isSet ?{core::int} local1{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local1' has not been initialized.");
function #local1#set(core::int #t1) → dynamic {
#local1#isSet = true;
return local1 = #t1;
}
#local1#set.call(0);
self::expect(0, #local1#get.call());
#local1#set.call(#local1#get.call().{core::num::+}(2));
self::expect(2, #local1#get.call());
core::int? local2;
function #local2#get() → core::int
return let final core::int? #t3 = local2 in #t3.==(null) ?{core::int} local2 = 1 : #t3{core::int};
function #local2#set(core::int #t4) → dynamic
return local2 = #t4;
core::bool #local2#isSet = false;
function #local2#get() → core::int {
if(!#local2#isSet) {
local2 = 1;
#local2#isSet = true;
}
return local2{core::int};
}
function #local2#set(core::int #t2) → dynamic {
#local2#isSet = true;
return local2 = #t2;
}
self::expect(1, #local2#get.call());
#local2#set.call(#local2#get.call().{core::num::+}(2));
self::expect(3, #local2#get.call());
}
static method error() → dynamic {
final core::int? local;
core::bool #local#isSet = false;
function #local#get() → core::int
return let final core::int? #t5 = local in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.") : #t5{core::int};
function #local#set(core::int #t6) → dynamic
if(local.==(null))
return local = #t6;
else
return #local#isSet ?{core::int} local{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.");
function #local#set(core::int #t3) → dynamic
if(#local#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local' has already been initialized.");
#local#set.call((let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/compound.dart:20:3: Error: Non-nullable late variable 'local' without initializer is definitely unassigned.
else {
#local#isSet = true;
return local = #t3;
}
#local#set.call((let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/late_lowering/compound.dart:20:3: Error: Non-nullable late variable 'local' without initializer is definitely unassigned.
local += 0;
^^^^^" in #local#get.call()).{core::num::+}(0));
}

View file

@ -16,18 +16,24 @@ import "dart:_internal" as _in;
class A extends core::Object {
field core::num? _#A#invariantField = null;
field core::bool _#A#invariantField#isSet = false;
field core::num? _#A#covariantField = null;
field core::bool _#A#covariantField#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
get invariantField() → core::num
return let final core::num? #t1 = this.{self::A::_#A#invariantField} in #t1.==(null) ?{core::num} throw new _in::LateInitializationErrorImpl::•("Field 'invariantField' has not been initialized.") : #t1{core::num};
set invariantField(core::num #t2) → void
return this.{self::A::_#A#invariantField#isSet} ?{core::num} let final core::num? #t1 = this.{self::A::_#A#invariantField} in #t1{core::num} : throw new _in::LateInitializationErrorImpl::•("Field 'invariantField' has not been initialized.");
set invariantField(core::num #t2) → void {
this.{self::A::_#A#invariantField#isSet} = true;
this.{self::A::_#A#invariantField} = #t2;
}
get covariantField() → core::num
return let final core::num? #t3 = this.{self::A::_#A#covariantField} in #t3.==(null) ?{core::num} throw new _in::LateInitializationErrorImpl::•("Field 'covariantField' has not been initialized.") : #t3{core::num};
set covariantField(covariant core::num #t4) → void
return this.{self::A::_#A#covariantField#isSet} ?{core::num} let final core::num? #t3 = this.{self::A::_#A#covariantField} in #t3{core::num} : throw new _in::LateInitializationErrorImpl::•("Field 'covariantField' has not been initialized.");
set covariantField(covariant core::num #t4) → void {
this.{self::A::_#A#covariantField#isSet} = true;
this.{self::A::_#A#covariantField} = #t4;
}
}
abstract class B extends core::Object implements self::A {
synthetic constructor •() → self::B

View file

@ -77,31 +77,37 @@ static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect
return local2 = #t1;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
function #local4#set(core::int #t3) → dynamic
if(local4.==(null))
return local4 = #t3;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t2) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t2;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t5) → dynamic
if(local6.==(null))
return local6 = #t5;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t3) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t3;
}
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:30:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:30:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:31:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:31:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:32:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:32:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
};
@ -110,29 +116,35 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
core::bool #local2#isSet = false;
function #local2#get() → T%
return #local2#isSet ?{T%} local2{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(T% #t9) → dynamic
function #local2#set(T% #t7) → dynamic
if(#local2#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local2' has already been initialized.");
else {
#local2#isSet = true;
return local2 = #t9;
return local2 = #t7;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t10 = local4 in #t10.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t10{core::int};
function #local4#set(core::int #t11) → dynamic
if(local4.==(null))
return local4 = #t11;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t8) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t8;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t13) → dynamic
if(local6.==(null))
return local6 = #t13;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t9) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t9;
}
if(b) {
#local2#set.call(value);
#local4#set.call(0);
@ -141,27 +153,30 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:70:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:70:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:71:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:71:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t16 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:72:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:72:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
};
static field () → core::Null? fieldCompound = () → core::Null? {
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t17 = local4 in #t17.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t17{core::int};
function #local4#set(core::int #t18) → dynamic
if(local4.==(null))
return local4 = #t18;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t13) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t13;
}
#local4#set.call(0);
let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:88:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:88:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 += 0; // error
^^^^^^" in #local4#set.call(#local4#get.call().{core::num::+}(0));
};
@ -170,39 +185,45 @@ static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect
core::bool #local2#isSet = false;
function #local2#get() → self::methodDirect::T%
return #local2#isSet ?{self::methodDirect::T%} local2{self::methodDirect::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodDirect::T% #t20) → dynamic
function #local2#set(self::methodDirect::T% #t15) → dynamic
if(#local2#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local2' has already been initialized.");
else {
#local2#isSet = true;
return local2 = #t20;
return local2 = #t15;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t21 = local4 in #t21.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t21{core::int};
function #local4#set(core::int #t22) → dynamic
if(local4.==(null))
return local4 = #t22;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t16) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t16;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t24) → dynamic
if(local6.==(null))
return local6 = #t24;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t17) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t17;
}
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:16:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t18 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:16:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t26 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:17:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:17:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t27 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:18:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t20 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:18:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
}
@ -211,29 +232,35 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
core::bool #local2#isSet = false;
function #local2#get() → self::methodConditional::T%
return #local2#isSet ?{self::methodConditional::T%} local2{self::methodConditional::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodConditional::T% #t28) → dynamic
function #local2#set(self::methodConditional::T% #t21) → dynamic
if(#local2#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local2' has already been initialized.");
else {
#local2#isSet = true;
return local2 = #t28;
return local2 = #t21;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t29 = local4 in #t29.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t29{core::int};
function #local4#set(core::int #t30) → dynamic
if(local4.==(null))
return local4 = #t30;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t22) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t22;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t32) → dynamic
if(local6.==(null))
return local6 = #t32;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t23) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t23;
}
if(b) {
#local2#set.call(value);
#local4#set.call(0);
@ -242,27 +269,30 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t33 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:50:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t24 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:50:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t34 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:51:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:51:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t35 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:52:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t26 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:52:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
}
static method methodCompound() → dynamic {
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t36 = local4 in #t36.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t36{core::int};
function #local4#set(core::int #t37) → dynamic
if(local4.==(null))
return local4 = #t37;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t27) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t27;
}
#local4#set.call(0);
let final<BottomType> #t38 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:80:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t28 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:80:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 += 0; // error
^^^^^^" in #local4#set.call(#local4#get.call().{core::num::+}(0));
}

View file

@ -77,31 +77,37 @@ static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect
return local2 = #t1;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
function #local4#set(core::int #t3) → dynamic
if(local4.==(null))
return local4 = #t3;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t2) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t2;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t5) → dynamic
if(local6.==(null))
return local6 = #t5;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t3) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t3;
}
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:30:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:30:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:31:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:31:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:32:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:32:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
};
@ -110,29 +116,35 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
core::bool #local2#isSet = false;
function #local2#get() → T%
return #local2#isSet ?{T%} local2{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(T% #t9) → dynamic
function #local2#set(T% #t7) → dynamic
if(#local2#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local2' has already been initialized.");
else {
#local2#isSet = true;
return local2 = #t9;
return local2 = #t7;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t10 = local4 in #t10.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t10{core::int};
function #local4#set(core::int #t11) → dynamic
if(local4.==(null))
return local4 = #t11;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t8) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t8;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t12 = local6 in #t12.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t12{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t13) → dynamic
if(local6.==(null))
return local6 = #t13;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t9) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t9;
}
if(b) {
#local2#set.call(value);
#local4#set.call(0);
@ -141,27 +153,30 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:70:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:70:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:71:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:71:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t16 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:72:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:72:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
};
static field () → core::Null? fieldCompound = () → core::Null? {
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t17 = local4 in #t17.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t17{core::int};
function #local4#set(core::int #t18) → dynamic
if(local4.==(null))
return local4 = #t18;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t13) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t13;
}
#local4#set.call(0);
let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:88:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:88:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 += 0; // error
^^^^^^" in #local4#set.call(#local4#get.call().{core::num::+}(0));
};
@ -170,39 +185,45 @@ static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect
core::bool #local2#isSet = false;
function #local2#get() → self::methodDirect::T%
return #local2#isSet ?{self::methodDirect::T%} local2{self::methodDirect::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodDirect::T% #t20) → dynamic
function #local2#set(self::methodDirect::T% #t15) → dynamic
if(#local2#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local2' has already been initialized.");
else {
#local2#isSet = true;
return local2 = #t20;
return local2 = #t15;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t21 = local4 in #t21.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t21{core::int};
function #local4#set(core::int #t22) → dynamic
if(local4.==(null))
return local4 = #t22;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t16) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t16;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t23 = local6 in #t23.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t23{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t24) → dynamic
if(local6.==(null))
return local6 = #t24;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t17) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t17;
}
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:16:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t18 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:16:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t26 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:17:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:17:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t27 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:18:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t20 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:18:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
}
@ -211,29 +232,35 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
core::bool #local2#isSet = false;
function #local2#get() → self::methodConditional::T%
return #local2#isSet ?{self::methodConditional::T%} local2{self::methodConditional::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodConditional::T% #t28) → dynamic
function #local2#set(self::methodConditional::T% #t21) → dynamic
if(#local2#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local2' has already been initialized.");
else {
#local2#isSet = true;
return local2 = #t28;
return local2 = #t21;
}
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t29 = local4 in #t29.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t29{core::int};
function #local4#set(core::int #t30) → dynamic
if(local4.==(null))
return local4 = #t30;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t22) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t22;
}
final FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t31 = local6 in #t31.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t31{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t32) → dynamic
if(local6.==(null))
return local6 = #t32;
else
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t23) → dynamic
if(#local6#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local6' has already been initialized.");
else {
#local6#isSet = true;
return local6 = #t23;
}
if(b) {
#local2#set.call(value);
#local4#set.call(0);
@ -242,27 +269,30 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
#local2#set.call(value);
#local4#set.call(0);
#local6#set.call(0);
let final<BottomType> #t33 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:50:3: Error: Non-nullable late final variable 'local2' definitely assigned.
let final<BottomType> #t24 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:50:3: Error: Non-nullable late final variable 'local2' definitely assigned.
local2 = value; // error
^^^^^^" in #local2#set.call(value);
let final<BottomType> #t34 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:51:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:51:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 = 0; // error
^^^^^^" in #local4#set.call(0);
let final<BottomType> #t35 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:52:3: Error: Non-nullable late final variable 'local6' definitely assigned.
let final<BottomType> #t26 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:52:3: Error: Non-nullable late final variable 'local6' definitely assigned.
local6 = 0; // error
^^^^^^" in #local6#set.call(0);
}
static method methodCompound() → dynamic {
final core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t36 = local4 in #t36.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t36{core::int};
function #local4#set(core::int #t37) → dynamic
if(local4.==(null))
return local4 = #t37;
else
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t27) → dynamic
if(#local4#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'local4' has already been initialized.");
else {
#local4#isSet = true;
return local4 = #t27;
}
#local4#set.call(0);
let final<BottomType> #t38 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:80:3: Error: Non-nullable late final variable 'local4' definitely assigned.
let final<BottomType> #t28 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_assigned.dart:80:3: Error: Non-nullable late final variable 'local4' definitely assigned.
local4 += 0; // error
^^^^^^" in #local4#set.call(#local4#get.call().{core::num::+}(0));
}

View file

@ -108,16 +108,22 @@ static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
function #local4#set(core::int #t3) → dynamic
return local4 = #t3;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t2) → dynamic {
#local4#isSet = true;
return local4 = #t2;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t5) → dynamic
return local6 = #t5;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t3) → dynamic {
#local6#isSet = true;
return local6 = #t3;
}
T? local7;
core::bool #local7#isSet = false;
function #local7#get() → T% {
@ -127,26 +133,26 @@ static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect
}
return local7{T%};
}
function #local7#set(T% #t6) → dynamic {
function #local7#set(T% #t4) → dynamic {
#local7#isSet = true;
return local7 = #t6;
return local7 = #t4;
}
let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:34:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:34:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:35:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:35:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
local2; // error
^^^^^^" in #local2#get.call();
let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:36:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:36:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:37:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:37:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4; // error
^^^^^^" in #local4#get.call();
let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:38:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:38:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:39:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:39:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
local6; // error
^^^^^^" in #local6#get.call();
#local7#get.call();
@ -157,22 +163,28 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
core::bool #local2#isSet = false;
function #local2#get() → T%
return #local2#isSet ?{T%} local2{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(T% #t13) → dynamic {
function #local2#set(T% #t11) → dynamic {
#local2#isSet = true;
return local2 = #t13;
return local2 = #t11;
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t14 = local4 in #t14.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t14{core::int};
function #local4#set(core::int #t15) → dynamic
return local4 = #t15;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t12) → dynamic {
#local4#isSet = true;
return local4 = #t12;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t17) → dynamic
return local6 = #t17;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t13) → dynamic {
#local6#isSet = true;
return local6 = #t13;
}
T? local7;
core::bool #local7#isSet = false;
function #local7#get() → T% {
@ -182,9 +194,9 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
}
return local7{T%};
}
function #local7#set(T% #t18) → dynamic {
function #local7#set(T% #t14) → dynamic {
#local7#isSet = true;
return local7 = #t18;
return local7 = #t14;
}
if(b) {
local1 = value;
@ -195,15 +207,15 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
#local6#set.call(0);
#local7#get.call();
}
let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:90:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:90:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
#local2#get.call();
let final<BottomType> #t20 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:92:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t16 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:92:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
#local4#get.call();
let final<BottomType> #t21 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:94:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t17 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:94:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
#local6#get.call();
@ -212,14 +224,17 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
static field () → core::Null? fieldCompound = () → core::Null? {
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t22 = local4 in #t22.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t22{core::int};
function #local4#set(core::int #t23) → dynamic
return local4 = #t23;
local3 = (let final<BottomType> #t24 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:111:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t18) → dynamic {
#local4#isSet = true;
return local4 = #t18;
}
local3 = (let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:111:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3 += 0; // error
^^^^^^" in local3).{core::num::+}(0);
#local4#set.call((let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:112:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
#local4#set.call((let final<BottomType> #t20 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:112:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4 += 0; // error
^^^^^^" in #local4#get.call()).{core::num::+}(0));
};
@ -229,22 +244,28 @@ static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect
core::bool #local2#isSet = false;
function #local2#get() → self::methodDirect::T%
return #local2#isSet ?{self::methodDirect::T%} local2{self::methodDirect::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodDirect::T% #t26) → dynamic {
function #local2#set(self::methodDirect::T% #t21) → dynamic {
#local2#isSet = true;
return local2 = #t26;
return local2 = #t21;
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t27 = local4 in #t27.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t27{core::int};
function #local4#set(core::int #t28) → dynamic
return local4 = #t28;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t22) → dynamic {
#local4#isSet = true;
return local4 = #t22;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t30) → dynamic
return local6 = #t30;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t23) → dynamic {
#local6#isSet = true;
return local6 = #t23;
}
self::methodDirect::T? local7;
core::bool #local7#isSet = false;
function #local7#get() → self::methodDirect::T% {
@ -254,26 +275,26 @@ static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect
}
return local7{self::methodDirect::T%};
}
function #local7#set(self::methodDirect::T% #t31) → dynamic {
function #local7#set(self::methodDirect::T% #t24) → dynamic {
#local7#isSet = true;
return local7 = #t31;
return local7 = #t24;
}
let final<BottomType> #t32 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:16:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:16:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
let final<BottomType> #t33 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:17:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
let final<BottomType> #t26 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:17:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
local2; // error
^^^^^^" in #local2#get.call();
let final<BottomType> #t34 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:18:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t27 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:18:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
let final<BottomType> #t35 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:19:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
let final<BottomType> #t28 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:19:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4; // error
^^^^^^" in #local4#get.call();
let final<BottomType> #t36 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:20:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t29 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:20:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
let final<BottomType> #t37 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:21:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
let final<BottomType> #t30 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:21:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
local6; // error
^^^^^^" in #local6#get.call();
#local7#get.call();
@ -284,22 +305,28 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
core::bool #local2#isSet = false;
function #local2#get() → self::methodConditional::T%
return #local2#isSet ?{self::methodConditional::T%} local2{self::methodConditional::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodConditional::T% #t38) → dynamic {
function #local2#set(self::methodConditional::T% #t31) → dynamic {
#local2#isSet = true;
return local2 = #t38;
return local2 = #t31;
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t39 = local4 in #t39.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t39{core::int};
function #local4#set(core::int #t40) → dynamic
return local4 = #t40;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t32) → dynamic {
#local4#isSet = true;
return local4 = #t32;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t42) → dynamic
return local6 = #t42;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t33) → dynamic {
#local6#isSet = true;
return local6 = #t33;
}
self::methodConditional::T? local7;
core::bool #local7#isSet = false;
function #local7#get() → self::methodConditional::T% {
@ -309,9 +336,9 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
}
return local7{self::methodConditional::T%};
}
function #local7#set(self::methodConditional::T% #t43) → dynamic {
function #local7#set(self::methodConditional::T% #t34) → dynamic {
#local7#isSet = true;
return local7 = #t43;
return local7 = #t34;
}
if(b) {
local1 = value;
@ -322,15 +349,15 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
#local6#set.call(0);
#local7#set.call(value);
}
let final<BottomType> #t44 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:62:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t35 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:62:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
#local2#get.call();
let final<BottomType> #t45 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:64:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t36 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:64:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
#local4#get.call();
let final<BottomType> #t46 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:66:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t37 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:66:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
#local6#get.call();
@ -339,14 +366,17 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
static method methodCompound() → dynamic {
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t47 = local4 in #t47.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t47{core::int};
function #local4#set(core::int #t48) → dynamic
return local4 = #t48;
local3 = (let final<BottomType> #t49 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:103:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t38) → dynamic {
#local4#isSet = true;
return local4 = #t38;
}
local3 = (let final<BottomType> #t39 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:103:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3 += 0; // error
^^^^^^" in local3).{core::num::+}(0);
#local4#set.call((let final<BottomType> #t50 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:104:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
#local4#set.call((let final<BottomType> #t40 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:104:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4 += 0; // error
^^^^^^" in #local4#get.call()).{core::num::+}(0));
}

View file

@ -108,16 +108,22 @@ static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t2 = local4 in #t2.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t2{core::int};
function #local4#set(core::int #t3) → dynamic
return local4 = #t3;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t2) → dynamic {
#local4#isSet = true;
return local4 = #t2;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t4 = local6 in #t4.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t4{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t5) → dynamic
return local6 = #t5;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t3) → dynamic {
#local6#isSet = true;
return local6 = #t3;
}
T? local7;
core::bool #local7#isSet = false;
function #local7#get() → T% {
@ -127,26 +133,26 @@ static field <T extends core::Object? = dynamic>(T%) → core::Null? fieldDirect
}
return local7{T%};
}
function #local7#set(T% #t6) → dynamic {
function #local7#set(T% #t4) → dynamic {
#local7#isSet = true;
return local7 = #t6;
return local7 = #t4;
}
let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:34:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:34:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:35:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:35:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
local2; // error
^^^^^^" in #local2#get.call();
let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:36:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:36:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:37:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:37:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4; // error
^^^^^^" in #local4#get.call();
let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:38:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:38:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:39:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:39:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
local6; // error
^^^^^^" in #local6#get.call();
#local7#get.call();
@ -157,22 +163,28 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
core::bool #local2#isSet = false;
function #local2#get() → T%
return #local2#isSet ?{T%} local2{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(T% #t13) → dynamic {
function #local2#set(T% #t11) → dynamic {
#local2#isSet = true;
return local2 = #t13;
return local2 = #t11;
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t14 = local4 in #t14.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t14{core::int};
function #local4#set(core::int #t15) → dynamic
return local4 = #t15;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t12) → dynamic {
#local4#isSet = true;
return local4 = #t12;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t16 = local6 in #t16.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t16{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t17) → dynamic
return local6 = #t17;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t13) → dynamic {
#local6#isSet = true;
return local6 = #t13;
}
T? local7;
core::bool #local7#isSet = false;
function #local7#get() → T% {
@ -182,9 +194,9 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
}
return local7{T%};
}
function #local7#set(T% #t18) → dynamic {
function #local7#set(T% #t14) → dynamic {
#local7#isSet = true;
return local7 = #t18;
return local7 = #t14;
}
if(b) {
local1 = value;
@ -195,15 +207,15 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
#local6#set.call(0);
#local7#get.call();
}
let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:90:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:90:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
#local2#get.call();
let final<BottomType> #t20 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:92:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t16 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:92:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
#local4#get.call();
let final<BottomType> #t21 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:94:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t17 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:94:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
#local6#get.call();
@ -212,14 +224,17 @@ static field <T extends core::Object? = dynamic>(core::bool, T%) → core::Null?
static field () → core::Null? fieldCompound = () → core::Null? {
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t22 = local4 in #t22.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t22{core::int};
function #local4#set(core::int #t23) → dynamic
return local4 = #t23;
local3 = (let final<BottomType> #t24 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:111:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t18) → dynamic {
#local4#isSet = true;
return local4 = #t18;
}
local3 = (let final<BottomType> #t19 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:111:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3 += 0; // error
^^^^^^" in local3).{core::num::+}(0);
#local4#set.call((let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:112:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
#local4#set.call((let final<BottomType> #t20 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:112:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4 += 0; // error
^^^^^^" in #local4#get.call()).{core::num::+}(0));
};
@ -229,22 +244,28 @@ static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect
core::bool #local2#isSet = false;
function #local2#get() → self::methodDirect::T%
return #local2#isSet ?{self::methodDirect::T%} local2{self::methodDirect::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodDirect::T% #t26) → dynamic {
function #local2#set(self::methodDirect::T% #t21) → dynamic {
#local2#isSet = true;
return local2 = #t26;
return local2 = #t21;
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t27 = local4 in #t27.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t27{core::int};
function #local4#set(core::int #t28) → dynamic
return local4 = #t28;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t22) → dynamic {
#local4#isSet = true;
return local4 = #t22;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t29 = local6 in #t29.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t29{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t30) → dynamic
return local6 = #t30;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t23) → dynamic {
#local6#isSet = true;
return local6 = #t23;
}
self::methodDirect::T? local7;
core::bool #local7#isSet = false;
function #local7#get() → self::methodDirect::T% {
@ -254,26 +275,26 @@ static method methodDirect<T extends core::Object? = dynamic>(self::methodDirect
}
return local7{self::methodDirect::T%};
}
function #local7#set(self::methodDirect::T% #t31) → dynamic {
function #local7#set(self::methodDirect::T% #t24) → dynamic {
#local7#isSet = true;
return local7 = #t31;
return local7 = #t24;
}
let final<BottomType> #t32 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:16:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t25 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:16:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
let final<BottomType> #t33 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:17:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
let final<BottomType> #t26 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:17:3: Error: Non-nullable late variable 'local2' without initializer is definitely unassigned.
local2; // error
^^^^^^" in #local2#get.call();
let final<BottomType> #t34 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:18:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t27 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:18:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
let final<BottomType> #t35 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:19:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
let final<BottomType> #t28 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:19:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4; // error
^^^^^^" in #local4#get.call();
let final<BottomType> #t36 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:20:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t29 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:20:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
let final<BottomType> #t37 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:21:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
let final<BottomType> #t30 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:21:3: Error: Non-nullable late variable 'local6' without initializer is definitely unassigned.
local6; // error
^^^^^^" in #local6#get.call();
#local7#get.call();
@ -284,22 +305,28 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
core::bool #local2#isSet = false;
function #local2#get() → self::methodConditional::T%
return #local2#isSet ?{self::methodConditional::T%} local2{self::methodConditional::T%} : throw new _in::LateInitializationErrorImpl::•("Local 'local2' has not been initialized.");
function #local2#set(self::methodConditional::T% #t38) → dynamic {
function #local2#set(self::methodConditional::T% #t31) → dynamic {
#local2#isSet = true;
return local2 = #t38;
return local2 = #t31;
}
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t39 = local4 in #t39.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t39{core::int};
function #local4#set(core::int #t40) → dynamic
return local4 = #t40;
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t32) → dynamic {
#local4#isSet = true;
return local4 = #t32;
}
FutureOr<core::int>local5;
FutureOr<core::int>? local6;
core::bool #local6#isSet = false;
function #local6#get() → FutureOr<core::int>
return let final FutureOr<core::int>? #t41 = local6 in #t41.==(null) ?{FutureOr<core::int>} throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.") : #t41{FutureOr<core::int>};
function #local6#set(FutureOr<core::int>#t42) → dynamic
return local6 = #t42;
return #local6#isSet ?{FutureOr<core::int>} local6{FutureOr<core::int>} : throw new _in::LateInitializationErrorImpl::•("Local 'local6' has not been initialized.");
function #local6#set(FutureOr<core::int>#t33) → dynamic {
#local6#isSet = true;
return local6 = #t33;
}
self::methodConditional::T? local7;
core::bool #local7#isSet = false;
function #local7#get() → self::methodConditional::T% {
@ -309,9 +336,9 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
}
return local7{self::methodConditional::T%};
}
function #local7#set(self::methodConditional::T% #t43) → dynamic {
function #local7#set(self::methodConditional::T% #t34) → dynamic {
#local7#isSet = true;
return local7 = #t43;
return local7 = #t34;
}
if(b) {
local1 = value;
@ -322,15 +349,15 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
#local6#set.call(0);
#local7#set.call(value);
}
let final<BottomType> #t44 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:62:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
let final<BottomType> #t35 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:62:3: Error: Non-nullable variable 'local1' must be assigned before it can be used.
local1; // error
^^^^^^" in local1;
#local2#get.call();
let final<BottomType> #t45 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:64:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
let final<BottomType> #t36 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:64:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3; // error
^^^^^^" in local3;
#local4#get.call();
let final<BottomType> #t46 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:66:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
let final<BottomType> #t37 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:66:3: Error: Non-nullable variable 'local5' must be assigned before it can be used.
local5; // error
^^^^^^" in local5;
#local6#get.call();
@ -339,14 +366,17 @@ static method methodConditional<T extends core::Object? = dynamic>(core::bool b,
static method methodCompound() → dynamic {
core::int local3;
core::int? local4;
core::bool #local4#isSet = false;
function #local4#get() → core::int
return let final core::int? #t47 = local4 in #t47.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.") : #t47{core::int};
function #local4#set(core::int #t48) → dynamic
return local4 = #t48;
local3 = (let final<BottomType> #t49 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:103:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
return #local4#isSet ?{core::int} local4{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local4' has not been initialized.");
function #local4#set(core::int #t38) → dynamic {
#local4#isSet = true;
return local4 = #t38;
}
local3 = (let final<BottomType> #t39 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:103:3: Error: Non-nullable variable 'local3' must be assigned before it can be used.
local3 += 0; // error
^^^^^^" in local3).{core::num::+}(0);
#local4#set.call((let final<BottomType> #t50 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:104:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
#local4#set.call((let final<BottomType> #t40 = invalid-expression "pkg/front_end/testcases/late_lowering/definitely_unassigned.dart:104:3: Error: Non-nullable late variable 'local4' without initializer is definitely unassigned.
local4 += 0; // error
^^^^^^" in #local4#get.call()).{core::num::+}(0));
}

View file

@ -7,9 +7,12 @@ static method f<T extends core::Object? = dynamic>(self::f::T% t) → self::f::T
return t;
static method main() → dynamic {
core::int? local;
core::bool #local#isSet = false;
function #local#get() → core::int
return let final core::int? #t1 = local in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.") : #t1{core::int};
function #local#set(core::int #t2) → dynamic
return local = #t2;
return #local#isSet ?{core::int} local{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.");
function #local#set(core::int #t1) → dynamic {
#local#isSet = true;
return local = #t1;
}
#local#set.call(self::f<core::int>(0));
}

View file

@ -7,9 +7,12 @@ static method f<T extends core::Object? = dynamic>(self::f::T% t) → self::f::T
return t;
static method main() → dynamic {
core::int? local;
core::bool #local#isSet = false;
function #local#get() → core::int
return let final core::int? #t1 = local in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.") : #t1{core::int};
function #local#set(core::int #t2) → dynamic
return local = #t2;
return #local#isSet ?{core::int} local{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.");
function #local#set(core::int #t1) → dynamic {
#local#isSet = true;
return local = #t1;
}
#local#set.call(self::f<core::int>(0));
}

View file

@ -6,11 +6,13 @@ import "dart:_internal" as _in;
class Class extends core::Object {
static field core::int nonNullableStaticFieldReads = 0;
static field core::int? _#nonNullableStaticField = null;
static field core::bool _#nonNullableStaticField#isSet = false;
static field core::int nullableStaticFieldReads = 0;
static field core::int? _#nullableStaticField = null;
static field core::bool _#nullableStaticField#isSet = false;
field core::int nonNullableInstanceFieldReads = 0;
field core::int? _#Class#nonNullableInstanceField = null;
field core::bool _#Class#nonNullableInstanceField#isSet = false;
field core::int nullableInstanceFieldReads = 0;
field core::int? _#Class#nullableInstanceField = null;
field core::bool _#Class#nullableInstanceField#isSet = false;
@ -44,6 +46,7 @@ class Class extends core::Object {
}
static field core::int nonNullableTopLevelFieldReads = 0;
static field core::int? _#nonNullableTopLevelField = null;
static field core::bool _#nonNullableTopLevelField#isSet = false;
static field core::int nullableTopLevelFieldReads = 0;
static field core::int? _#nullableTopLevelField = null;
static field core::bool _#nullableTopLevelField#isSet = false;

View file

@ -6,11 +6,13 @@ import "dart:_internal" as _in;
class Class extends core::Object {
static field core::int nonNullableStaticFieldReads = 0;
static field core::int? _#nonNullableStaticField = null;
static field core::bool _#nonNullableStaticField#isSet = false;
static field core::int nullableStaticFieldReads = 0;
static field core::int? _#nullableStaticField = null;
static field core::bool _#nullableStaticField#isSet = false;
field core::int nonNullableInstanceFieldReads = 0;
field core::int? _#Class#nonNullableInstanceField = null;
field core::bool _#Class#nonNullableInstanceField#isSet = false;
field core::int nullableInstanceFieldReads = 0;
field core::int? _#Class#nullableInstanceField = null;
field core::bool _#Class#nullableInstanceField#isSet = false;
@ -44,6 +46,7 @@ class Class extends core::Object {
}
static field core::int nonNullableTopLevelFieldReads = 0;
static field core::int? _#nonNullableTopLevelField = null;
static field core::bool _#nonNullableTopLevelField#isSet = false;
static field core::int nullableTopLevelFieldReads = 0;
static field core::int? _#nullableTopLevelField = null;
static field core::bool _#nullableTopLevelField#isSet = false;

View file

@ -15,16 +15,19 @@ import "dart:_internal";
@#C1
class Class extends core::Object {
field core::int? _#Class#foo = null /* from org-dartlang-testcase:///patch_lib.dart */;
field core::bool _#Class#foo#isSet = false /* from org-dartlang-testcase:///patch_lib.dart */;
constructor bar() → self2::Class
: super core::Object::•()
;
constructor baz(core::int foo) → self2::Class
: self2::Class::_#Class#foo = foo, super core::Object::•()
: self2::Class::_#Class#foo#isSet = true, self2::Class::_#Class#foo = foo, super core::Object::•()
;
get /* from org-dartlang-testcase:///patch_lib.dart */ foo() → core::int
return let final core::int? #t1 = this.{self2::Class::_#Class#foo} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'foo' has not been initialized.") : #t1{core::int};
set /* from org-dartlang-testcase:///patch_lib.dart */ foo(core::int #t2) → void
return this.{self2::Class::_#Class#foo#isSet} ?{core::int} let final core::int? #t1 = this.{self2::Class::_#Class#foo} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'foo' has not been initialized.");
set /* from org-dartlang-testcase:///patch_lib.dart */ foo(core::int #t2) → void {
this.{self2::Class::_#Class#foo#isSet} = true;
this.{self2::Class::_#Class#foo} = #t2;
}
}
constants {

View file

@ -15,16 +15,19 @@ import "dart:_internal";
@#C1
class Class extends core::Object {
field core::int? _#Class#foo = null /* from org-dartlang-testcase:///patch_lib.dart */;
field core::bool _#Class#foo#isSet = false /* from org-dartlang-testcase:///patch_lib.dart */;
constructor bar() → self2::Class
: super core::Object::•()
;
constructor baz(core::int foo) → self2::Class
: self2::Class::_#Class#foo = foo, super core::Object::•()
: self2::Class::_#Class#foo#isSet = true, self2::Class::_#Class#foo = foo, super core::Object::•()
;
get /* from org-dartlang-testcase:///patch_lib.dart */ foo() → core::int
return let final core::int? #t1 = this.{self2::Class::_#Class#foo} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'foo' has not been initialized.") : #t1{core::int};
set /* from org-dartlang-testcase:///patch_lib.dart */ foo(core::int #t2) → void
return this.{self2::Class::_#Class#foo#isSet} ?{core::int} let final core::int? #t1 = this.{self2::Class::_#Class#foo} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'foo' has not been initialized.");
set /* from org-dartlang-testcase:///patch_lib.dart */ foo(core::int #t2) → void {
this.{self2::Class::_#Class#foo#isSet} = true;
this.{self2::Class::_#Class#foo} = #t2;
}
}
constants {

View file

@ -4,22 +4,30 @@ import "dart:core" as core;
class Class extends core::Object {
field core::int? _#Class#field = null;
field core::bool _#Class#field#isSet = false;
constructor constructor1() → self::Class
: super core::Object::•()
;
constructor constructor2(core::int field) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
constructor constructor3(core::int value) → self::Class
: self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
;
constructor constructor4([core::int field = #C1]) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
get field() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1.==(null) ?{core::int} this.{self::Class::_#Class#field} = 10 : #t1{core::int};
set field(core::int #t2) → void
get field() → core::int {
if(!this.{self::Class::_#Class#field#isSet}) {
this.{self::Class::_#Class#field} = 10;
this.{self::Class::_#Class#field#isSet} = true;
}
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1{core::int};
}
set field(core::int #t2) → void {
this.{self::Class::_#Class#field#isSet} = true;
this.{self::Class::_#Class#field} = #t2;
}
}
class Subclass extends self::Class {
constructor constructor1() → self::Subclass

View file

@ -4,22 +4,30 @@ import "dart:core" as core;
class Class extends core::Object {
field core::int? _#Class#field = null;
field core::bool _#Class#field#isSet = false;
constructor constructor1() → self::Class
: super core::Object::•()
;
constructor constructor2(core::int field) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
constructor constructor3(core::int value) → self::Class
: self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
;
constructor constructor4([core::int field = #C1]) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
get field() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1.==(null) ?{core::int} this.{self::Class::_#Class#field} = 10 : #t1{core::int};
set field(core::int #t2) → void
get field() → core::int {
if(!this.{self::Class::_#Class#field#isSet}) {
this.{self::Class::_#Class#field} = 10;
this.{self::Class::_#Class#field#isSet} = true;
}
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1{core::int};
}
set field(core::int #t2) → void {
this.{self::Class::_#Class#field#isSet} = true;
this.{self::Class::_#Class#field} = #t2;
}
}
class Subclass extends self::Class {
constructor constructor1() → self::Subclass

View file

@ -5,22 +5,25 @@ import "dart:_internal" as _in;
class Class extends core::Object {
field core::int? _#Class#field = null;
field core::bool _#Class#field#isSet = false;
constructor constructor1() → self::Class
: super core::Object::•()
;
constructor constructor2(core::int field) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
constructor constructor3(core::int value) → self::Class
: self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
;
constructor constructor4([core::int field = #C1]) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
get field() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.") : #t1{core::int};
set field(core::int #t2) → void
return this.{self::Class::_#Class#field#isSet} ?{core::int} let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.");
set field(core::int #t2) → void {
this.{self::Class::_#Class#field#isSet} = true;
this.{self::Class::_#Class#field} = #t2;
}
}
class Subclass extends self::Class {
constructor constructor1() → self::Subclass

View file

@ -5,22 +5,25 @@ import "dart:_internal" as _in;
class Class extends core::Object {
field core::int? _#Class#field = null;
field core::bool _#Class#field#isSet = false;
constructor constructor1() → self::Class
: super core::Object::•()
;
constructor constructor2(core::int field) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
constructor constructor3(core::int value) → self::Class
: self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
;
constructor constructor4([core::int field = #C1]) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
get field() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.") : #t1{core::int};
set field(core::int #t2) → void
return this.{self::Class::_#Class#field#isSet} ?{core::int} let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.");
set field(core::int #t2) → void {
this.{self::Class::_#Class#field#isSet} = true;
this.{self::Class::_#Class#field} = #t2;
}
}
class Subclass extends self::Class {
constructor constructor1() → self::Subclass

View file

@ -5,25 +5,28 @@ import "dart:_internal" as _in;
class Class extends core::Object {
field core::int? _#Class#field = null;
field core::bool _#Class#field#isSet = false;
constructor constructor1() → self::Class
: super core::Object::•()
;
constructor constructor2(core::int field) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
constructor constructor3(core::int value) → self::Class
: self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
;
constructor constructor4([core::int field = #C1]) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
get field() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.") : #t1{core::int};
return this.{self::Class::_#Class#field#isSet} ?{core::int} let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.");
set field(core::int #t2) → void
if(this.{self::Class::_#Class#field}.==(null))
this.{self::Class::_#Class#field} = #t2;
else
if(this.{self::Class::_#Class#field#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field' has already been initialized.");
else {
this.{self::Class::_#Class#field#isSet} = true;
this.{self::Class::_#Class#field} = #t2;
}
}
class Subclass extends self::Class {
constructor constructor1() → self::Subclass

View file

@ -5,25 +5,28 @@ import "dart:_internal" as _in;
class Class extends core::Object {
field core::int? _#Class#field = null;
field core::bool _#Class#field#isSet = false;
constructor constructor1() → self::Class
: super core::Object::•()
;
constructor constructor2(core::int field) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
constructor constructor3(core::int value) → self::Class
: self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = value.{core::num::+}(1), super core::Object::•()
;
constructor constructor4([core::int field = #C1]) → self::Class
: self::Class::_#Class#field = field, super core::Object::•()
: self::Class::_#Class#field#isSet = true, self::Class::_#Class#field = field, super core::Object::•()
;
get field() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.") : #t1{core::int};
return this.{self::Class::_#Class#field#isSet} ?{core::int} let final core::int? #t1 = this.{self::Class::_#Class#field} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field' has not been initialized.");
set field(core::int #t2) → void
if(this.{self::Class::_#Class#field}.==(null))
this.{self::Class::_#Class#field} = #t2;
else
if(this.{self::Class::_#Class#field#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field' has already been initialized.");
else {
this.{self::Class::_#Class#field#isSet} = true;
this.{self::Class::_#Class#field} = #t2;
}
}
class Subclass extends self::Class {
constructor constructor1() → self::Subclass

View file

@ -6,15 +6,23 @@ import "dart:_internal" as _in;
class C extends core::Object {
field core::num pi = 3.14;
field core::num? _#C#p1 = null;
field core::bool _#C#p1#isSet = false;
field core::num? _#C#p2 = null;
field core::bool _#C#p2#isSet = false;
synthetic constructor •() → self::C
: super core::Object::•()
;
get p1() → core::num
return let final core::num? #t1 = this.{self::C::_#C#p1} in #t1.==(null) ?{core::num} this.{self::C::_#C#p1} = this.{self::C::pi} : #t1{core::num};
set p1(core::num #t2) → void
get p1() → core::num {
if(!this.{self::C::_#C#p1#isSet}) {
this.{self::C::_#C#p1} = this.{self::C::pi};
this.{self::C::_#C#p1#isSet} = true;
}
return let final core::num? #t1 = this.{self::C::_#C#p1} in #t1{core::num};
}
set p1(core::num #t2) → void {
this.{self::C::_#C#p1#isSet} = true;
this.{self::C::_#C#p1} = #t2;
}
get p2() → core::num
return let final core::num? #t3 = this.{self::C::_#C#p2} in #t3.==(null) ?{core::num} let final core::num #t4 = this.{self::C::pi} in this.{self::C::_#C#p2}.==(null) ?{core::num} this.{self::C::_#C#p2} = #t4 : throw new _in::LateInitializationErrorImpl::•("Field 'p2' has been assigned during initialization.") : #t3{core::num};
}

View file

@ -6,15 +6,23 @@ import "dart:_internal" as _in;
class C extends core::Object {
field core::num pi = 3.14;
field core::num? _#C#p1 = null;
field core::bool _#C#p1#isSet = false;
field core::num? _#C#p2 = null;
field core::bool _#C#p2#isSet = false;
synthetic constructor •() → self::C
: super core::Object::•()
;
get p1() → core::num
return let final core::num? #t1 = this.{self::C::_#C#p1} in #t1.==(null) ?{core::num} this.{self::C::_#C#p1} = this.{self::C::pi} : #t1{core::num};
set p1(core::num #t2) → void
get p1() → core::num {
if(!this.{self::C::_#C#p1#isSet}) {
this.{self::C::_#C#p1} = this.{self::C::pi};
this.{self::C::_#C#p1#isSet} = true;
}
return let final core::num? #t1 = this.{self::C::_#C#p1} in #t1{core::num};
}
set p1(core::num #t2) → void {
this.{self::C::_#C#p1#isSet} = true;
this.{self::C::_#C#p1} = #t2;
}
get p2() → core::num
return let final core::num? #t3 = this.{self::C::_#C#p2} in #t3.==(null) ?{core::num} let final core::num #t4 = this.{self::C::pi} in this.{self::C::_#C#p2}.==(null) ?{core::num} this.{self::C::_#C#p2} = #t4 : throw new _in::LateInitializationErrorImpl::•("Field 'p2' has been assigned during initialization.") : #t3{core::num};
}

View file

@ -5,16 +5,19 @@ import "dart:_internal" as _in;
class C extends core::Object {
field core::int? _#C#x = null;
field core::bool _#C#x#isSet = false;
synthetic constructor •() → self::C
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{self::C::_#C#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
return this.{self::C::_#C#x#isSet} ?{core::int} let final core::int? #t1 = this.{self::C::_#C#x} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(covariant core::int #t2) → void
if(this.{self::C::_#C#x}.==(null))
this.{self::C::_#C#x} = #t2;
else
if(this.{self::C::_#C#x#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'x' has already been initialized.");
else {
this.{self::C::_#C#x#isSet} = true;
this.{self::C::_#C#x} = #t2;
}
}
class D extends self::C {
synthetic constructor •() → self::D

View file

@ -5,16 +5,19 @@ import "dart:_internal" as _in;
class C extends core::Object {
field core::int? _#C#x = null;
field core::bool _#C#x#isSet = false;
synthetic constructor •() → self::C
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{self::C::_#C#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
return this.{self::C::_#C#x#isSet} ?{core::int} let final core::int? #t1 = this.{self::C::_#C#x} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(covariant core::int #t2) → void
if(this.{self::C::_#C#x}.==(null))
this.{self::C::_#C#x} = #t2;
else
if(this.{self::C::_#C#x#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'x' has already been initialized.");
else {
this.{self::C::_#C#x#isSet} = true;
this.{self::C::_#C#x} = #t2;
}
}
class D extends self::C {
synthetic constructor •() → self::D

View file

@ -15,13 +15,16 @@ 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 •() → test::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{test::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
return this.{test::A::_#A#x#isSet} ?{core::int} let final core::int? #t1 = this.{test::A::_#A#x} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void {
this.{test::A::_#A#x#isSet} = true;
this.{test::A::_#A#x} = #t2;
}
}
class _B extends core::Object implements test::A {
field core::int x = 3;

View file

@ -15,13 +15,16 @@ 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 •() → test::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{test::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
return this.{test::A::_#A#x#isSet} ?{core::int} let final core::int? #t1 = this.{test::A::_#A#x} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void {
this.{test::A::_#A#x#isSet} = true;
this.{test::A::_#A#x} = #t2;
}
}
class _B extends core::Object implements test::A {
field core::int x = 3;

View file

@ -5,13 +5,16 @@ 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 let final core::int? #t1 = this.{self::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
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::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
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;

View file

@ -5,13 +5,16 @@ 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 let final core::int? #t1 = this.{self::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
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::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
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;

View file

@ -9,10 +9,14 @@ class C extends iss::B {
synthetic constructor •() → self::C
: super iss::B::•()
;
no-such-method-forwarder get /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x#isSet() → core::bool
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C1, 1, #C2, #C3, core::Map::unmodifiable<core::Symbol*, dynamic>(#C4))) as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
no-such-method-forwarder get /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x() → core::int?
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C1, 1, #C2, #C3, core::Map::unmodifiable<core::Symbol*, dynamic>(#C4))) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int?;
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 1, #C2, #C3, core::Map::unmodifiable<core::Symbol*, dynamic>(#C4))) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int?;
no-such-method-forwarder set /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x#isSet(core::bool value) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 2, #C2, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C4)));
no-such-method-forwarder set /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x(core::int? value) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 2, #C2, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C4)));
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 2, #C2, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C4)));
}
static method main() → dynamic {
new self::C::•();
@ -25,13 +29,16 @@ 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 •() → iss::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{iss::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
return this.{iss::A::_#A#x#isSet} ?{core::int} let final core::int? #t1 = this.{iss::A::_#A#x} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void {
this.{iss::A::_#A#x#isSet} = true;
this.{iss::A::_#A#x} = #t2;
}
}
class B extends core::Object implements iss::A {
field core::int x = 3;
@ -41,9 +48,11 @@ class B extends core::Object implements iss::A {
}
constants {
#C1 = #org-dartlang-testcase:///issue41436c.dart::_#A#x
#C1 = #org-dartlang-testcase:///issue41436c.dart::_#A#x#isSet
#C2 = <core::Type*>[]
#C3 = <dynamic>[]
#C4 = core::_ImmutableMap<core::Symbol*, dynamic> {_kvPairs:#C3}
#C5 = #org-dartlang-testcase:///issue41436c.dart::_#A#x=
#C5 = #org-dartlang-testcase:///issue41436c.dart::_#A#x
#C6 = #org-dartlang-testcase:///issue41436c.dart::_#A#x#isSet=
#C7 = #org-dartlang-testcase:///issue41436c.dart::_#A#x=
}

View file

@ -9,10 +9,14 @@ class C extends iss::B {
synthetic constructor •() → self::C
: super iss::B::•()
;
no-such-method-forwarder get /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x#isSet() → core::bool
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C1, 1, #C2, #C3, core::Map::unmodifiable<core::Symbol*, dynamic>(#C4))) as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
no-such-method-forwarder get /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x() → core::int?
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C1, 1, #C2, #C3, core::Map::unmodifiable<core::Symbol*, dynamic>(#C4))) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int?;
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 1, #C2, #C3, core::Map::unmodifiable<core::Symbol*, dynamic>(#C4))) as{TypeError,ForDynamic,ForNonNullableByDefault} core::int?;
no-such-method-forwarder set /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x#isSet(core::bool value) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C6, 2, #C2, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C4)));
no-such-method-forwarder set /* from org-dartlang-testcase:///issue41436c_lib.dart */ _#A#x(core::int? value) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C5, 2, #C2, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C4)));
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#C7, 2, #C2, core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol*, dynamic>(#C4)));
}
static method main() → dynamic {
new self::C::•();
@ -25,13 +29,16 @@ 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 •() → iss::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{iss::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
return this.{iss::A::_#A#x#isSet} ?{core::int} let final core::int? #t1 = this.{iss::A::_#A#x} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void {
this.{iss::A::_#A#x#isSet} = true;
this.{iss::A::_#A#x} = #t2;
}
}
class B extends core::Object implements iss::A {
field core::int x = 3;
@ -41,9 +48,11 @@ class B extends core::Object implements iss::A {
}
constants {
#C1 = #org-dartlang-testcase:///issue41436c.dart::_#A#x
#C1 = #org-dartlang-testcase:///issue41436c.dart::_#A#x#isSet
#C2 = <core::Type*>[]
#C3 = <dynamic>[]
#C4 = core::_ImmutableMap<core::Symbol*, dynamic> {_kvPairs:#C3}
#C5 = #org-dartlang-testcase:///issue41436c.dart::_#A#x=
#C5 = #org-dartlang-testcase:///issue41436c.dart::_#A#x
#C6 = #org-dartlang-testcase:///issue41436c.dart::_#A#x#isSet=
#C7 = #org-dartlang-testcase:///issue41436c.dart::_#A#x=
}

View file

@ -10,158 +10,209 @@ class Annotation extends core::Object /*hasConstConstructor*/ {
}
class A extends core::Object {
field core::int? _#A#instanceField = null;
field core::bool _#A#instanceField#isSet = false;
field core::int? _#A#finalInstanceField = null;
field core::bool _#A#finalInstanceField#isSet = false;
field core::int? _#A#finalInstanceFieldWithInitializer = null;
field core::bool _#A#finalInstanceFieldWithInitializer#isSet = false;
field core::num? _#A#covariantInstanceField = null;
field core::bool _#A#covariantInstanceField#isSet = false;
static field core::int? _#staticField = null;
static field core::bool _#staticField#isSet = false;
static field core::int? _#finalStaticField = null;
static field core::bool _#finalStaticField#isSet = false;
static field core::int? _#finalStaticFieldWithInitializer = null;
static field core::bool _#finalStaticFieldWithInitializer#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
@#C1
get instanceField() → core::int
return let final core::int? #t1 = this.{self::A::_#A#instanceField} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.") : #t1{core::int};
return this.{self::A::_#A#instanceField#isSet} ?{core::int} let final core::int? #t1 = this.{self::A::_#A#instanceField} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.");
@#C1
set instanceField(core::int #t2) → void
set instanceField(core::int #t2) → void {
this.{self::A::_#A#instanceField#isSet} = true;
this.{self::A::_#A#instanceField} = #t2;
}
@#C1
get finalInstanceField() → core::int
return let final core::int? #t3 = this.{self::A::_#A#finalInstanceField} in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.") : #t3{core::int};
return this.{self::A::_#A#finalInstanceField#isSet} ?{core::int} let final core::int? #t3 = this.{self::A::_#A#finalInstanceField} in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
@#C1
set finalInstanceField(core::int #t4) → void
if(this.{self::A::_#A#finalInstanceField}.==(null))
this.{self::A::_#A#finalInstanceField} = #t4;
else
if(this.{self::A::_#A#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{self::A::_#A#finalInstanceField#isSet} = true;
this.{self::A::_#A#finalInstanceField} = #t4;
}
@#C1
get finalInstanceFieldWithInitializer() → core::int
return let final core::int? #t5 = this.{self::A::_#A#finalInstanceFieldWithInitializer} in #t5.==(null) ?{core::int} let final core::int #t6 = 0 in this.{self::A::_#A#finalInstanceFieldWithInitializer}.==(null) ?{core::int} this.{self::A::_#A#finalInstanceFieldWithInitializer} = #t6 : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceFieldWithInitializer' has been assigned during initialization.") : #t5{core::int};
@#C1
get covariantInstanceField() → core::num
return let final core::num? #t7 = this.{self::A::_#A#covariantInstanceField} in #t7.==(null) ?{core::num} throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.") : #t7{core::num};
return this.{self::A::_#A#covariantInstanceField#isSet} ?{core::num} let final core::num? #t7 = this.{self::A::_#A#covariantInstanceField} in #t7{core::num} : throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.");
@#C1
set covariantInstanceField(covariant core::num #t8) → void
set covariantInstanceField(covariant core::num #t8) → void {
this.{self::A::_#A#covariantInstanceField#isSet} = true;
this.{self::A::_#A#covariantInstanceField} = #t8;
}
@#C1
static get staticField() → core::int
return let final core::int? #t9 = self::A::_#staticField in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.") : #t9{core::int};
return self::A::_#staticField#isSet ?{core::int} let final core::int? #t9 = self::A::_#staticField in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.");
@#C1
static set staticField(core::int #t10) → void
static set staticField(core::int #t10) → void {
self::A::_#staticField#isSet = true;
self::A::_#staticField = #t10;
}
@#C1
static get finalStaticField() → core::int
return let final core::int? #t11 = self::A::_#finalStaticField in #t11.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.") : #t11{core::int};
return self::A::_#finalStaticField#isSet ?{core::int} let final core::int? #t11 = self::A::_#finalStaticField in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.");
@#C1
static set finalStaticField(core::int #t12) → void
if(self::A::_#finalStaticField.==(null))
self::A::_#finalStaticField = #t12;
else
if(self::A::_#finalStaticField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has already been initialized.");
else {
self::A::_#finalStaticField#isSet = true;
self::A::_#finalStaticField = #t12;
}
@#C1
static get finalStaticFieldWithInitializer() → core::int
return let final core::int? #t13 = self::A::_#finalStaticFieldWithInitializer in #t13.==(null) ?{core::int} let final core::int #t14 = 0 in self::A::_#finalStaticFieldWithInitializer.==(null) ?{core::int} self::A::_#finalStaticFieldWithInitializer = #t14 : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticFieldWithInitializer' has been assigned during initialization.") : #t13{core::int};
}
abstract class B extends core::Object /*isMixinDeclaration*/ {
field core::int? _#B#instanceField = null;
field core::bool _#B#instanceField#isSet = false;
field core::int? _#B#finalInstanceField = null;
field core::bool _#B#finalInstanceField#isSet = false;
field core::int? _#B#finalInstanceFieldWithInitializer = null;
field core::bool _#B#finalInstanceFieldWithInitializer#isSet = false;
field core::num? _#B#covariantInstanceField = null;
field core::bool _#B#covariantInstanceField#isSet = false;
static field core::int? _#staticField = null;
static field core::bool _#staticField#isSet = false;
static field core::int? _#finalStaticField = null;
static field core::bool _#finalStaticField#isSet = false;
static field core::int? _#finalStaticFieldWithInitializer = null;
static field core::bool _#finalStaticFieldWithInitializer#isSet = false;
@#C1
get instanceField() → core::int
return let final core::int? #t15 = this.{self::B::_#B#instanceField} in #t15.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.") : #t15{core::int};
return this.{self::B::_#B#instanceField#isSet} ?{core::int} let final core::int? #t15 = this.{self::B::_#B#instanceField} in #t15{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.");
@#C1
set instanceField(core::int #t16) → void
set instanceField(core::int #t16) → void {
this.{self::B::_#B#instanceField#isSet} = true;
this.{self::B::_#B#instanceField} = #t16;
}
@#C1
get finalInstanceField() → core::int
return let final core::int? #t17 = this.{self::B::_#B#finalInstanceField} in #t17.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.") : #t17{core::int};
return this.{self::B::_#B#finalInstanceField#isSet} ?{core::int} let final core::int? #t17 = this.{self::B::_#B#finalInstanceField} in #t17{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
@#C1
set finalInstanceField(core::int #t18) → void
if(this.{self::B::_#B#finalInstanceField}.==(null))
this.{self::B::_#B#finalInstanceField} = #t18;
else
if(this.{self::B::_#B#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{self::B::_#B#finalInstanceField#isSet} = true;
this.{self::B::_#B#finalInstanceField} = #t18;
}
@#C1
get finalInstanceFieldWithInitializer() → core::int
return let final core::int? #t19 = this.{self::B::_#B#finalInstanceFieldWithInitializer} in #t19.==(null) ?{core::int} let final core::int #t20 = 0 in this.{self::B::_#B#finalInstanceFieldWithInitializer}.==(null) ?{core::int} this.{self::B::_#B#finalInstanceFieldWithInitializer} = #t20 : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceFieldWithInitializer' has been assigned during initialization.") : #t19{core::int};
@#C1
get covariantInstanceField() → core::num
return let final core::num? #t21 = this.{self::B::_#B#covariantInstanceField} in #t21.==(null) ?{core::num} throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.") : #t21{core::num};
return this.{self::B::_#B#covariantInstanceField#isSet} ?{core::num} let final core::num? #t21 = this.{self::B::_#B#covariantInstanceField} in #t21{core::num} : throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.");
@#C1
set covariantInstanceField(covariant core::num #t22) → void
set covariantInstanceField(covariant core::num #t22) → void {
this.{self::B::_#B#covariantInstanceField#isSet} = true;
this.{self::B::_#B#covariantInstanceField} = #t22;
}
@#C1
static get staticField() → core::int
return let final core::int? #t23 = self::B::_#staticField in #t23.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.") : #t23{core::int};
return self::B::_#staticField#isSet ?{core::int} let final core::int? #t23 = self::B::_#staticField in #t23{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.");
@#C1
static set staticField(core::int #t24) → void
static set staticField(core::int #t24) → void {
self::B::_#staticField#isSet = true;
self::B::_#staticField = #t24;
}
@#C1
static get finalStaticField() → core::int
return let final core::int? #t25 = self::B::_#finalStaticField in #t25.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.") : #t25{core::int};
return self::B::_#finalStaticField#isSet ?{core::int} let final core::int? #t25 = self::B::_#finalStaticField in #t25{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.");
@#C1
static set finalStaticField(core::int #t26) → void
if(self::B::_#finalStaticField.==(null))
self::B::_#finalStaticField = #t26;
else
if(self::B::_#finalStaticField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has already been initialized.");
else {
self::B::_#finalStaticField#isSet = true;
self::B::_#finalStaticField = #t26;
}
@#C1
static get finalStaticFieldWithInitializer() → core::int
return let final core::int? #t27 = self::B::_#finalStaticFieldWithInitializer in #t27.==(null) ?{core::int} let final core::int #t28 = 0 in self::B::_#finalStaticFieldWithInitializer.==(null) ?{core::int} self::B::_#finalStaticFieldWithInitializer = #t28 : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticFieldWithInitializer' has been assigned during initialization.") : #t27{core::int};
}
extension Extension on self::A {
static field extensionStaticField = self::_#Extension|extensionStaticField;
static field extensionStaticField = self::_#Extension|extensionStaticField#isSet;
static get extensionStaticField = get self::Extension|extensionStaticField;
static set extensionStaticField = set self::Extension|extensionStaticField;
static field finalExtensionStaticField = self::_#Extension|finalExtensionStaticField;
static field finalExtensionStaticField = self::_#Extension|finalExtensionStaticField#isSet;
static get finalExtensionStaticField = get self::Extension|finalExtensionStaticField;
static set finalExtensionStaticField = set self::Extension|finalExtensionStaticField;
static field finalExtensionStaticFieldWithInitializer = self::_#Extension|finalExtensionStaticFieldWithInitializer;
static field finalExtensionStaticFieldWithInitializer = self::_#Extension|finalExtensionStaticFieldWithInitializer#isSet;
static get finalExtensionStaticFieldWithInitializer = get self::Extension|finalExtensionStaticFieldWithInitializer;
}
static field core::int? _#topLevelField = null;
static field core::bool _#topLevelField#isSet = false;
static field core::int? _#finalTopLevelField = null;
static field core::bool _#finalTopLevelField#isSet = false;
static field core::int? _#finalTopLevelFieldWithInitializer = null;
static field core::bool _#finalTopLevelFieldWithInitializer#isSet = false;
static field core::int? _#Extension|extensionStaticField = null;
static field core::bool _#Extension|extensionStaticField#isSet = false;
static field core::int? _#Extension|finalExtensionStaticField = null;
static field core::bool _#Extension|finalExtensionStaticField#isSet = false;
static field core::int? _#Extension|finalExtensionStaticFieldWithInitializer = null;
static field core::bool _#Extension|finalExtensionStaticFieldWithInitializer#isSet = false;
@#C1
static get topLevelField() → core::int
return let final core::int? #t29 = self::_#topLevelField in #t29.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.") : #t29{core::int};
return self::_#topLevelField#isSet ?{core::int} let final core::int? #t29 = self::_#topLevelField in #t29{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.");
@#C1
static set topLevelField(core::int #t30) → void
static set topLevelField(core::int #t30) → void {
self::_#topLevelField#isSet = true;
self::_#topLevelField = #t30;
}
@#C1
static get finalTopLevelField() → core::int
return let final core::int? #t31 = self::_#finalTopLevelField in #t31.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.") : #t31{core::int};
return self::_#finalTopLevelField#isSet ?{core::int} let final core::int? #t31 = self::_#finalTopLevelField in #t31{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.");
@#C1
static set finalTopLevelField(core::int #t32) → void
if(self::_#finalTopLevelField.==(null))
self::_#finalTopLevelField = #t32;
else
if(self::_#finalTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has already been initialized.");
else {
self::_#finalTopLevelField#isSet = true;
self::_#finalTopLevelField = #t32;
}
@#C1
static get finalTopLevelFieldWithInitializer() → core::int
return let final core::int? #t33 = self::_#finalTopLevelFieldWithInitializer in #t33.==(null) ?{core::int} let final core::int #t34 = 0 in self::_#finalTopLevelFieldWithInitializer.==(null) ?{core::int} self::_#finalTopLevelFieldWithInitializer = #t34 : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelFieldWithInitializer' has been assigned during initialization.") : #t33{core::int};
@#C1
static get Extension|extensionStaticField() → core::int
return let final core::int? #t35 = self::_#Extension|extensionStaticField in #t35.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'extensionStaticField' has not been initialized.") : #t35{core::int};
return self::_#Extension|extensionStaticField#isSet ?{core::int} let final core::int? #t35 = self::_#Extension|extensionStaticField in #t35{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'extensionStaticField' has not been initialized.");
@#C1
static set Extension|extensionStaticField(core::int #t36) → void
static set Extension|extensionStaticField(core::int #t36) → void {
self::_#Extension|extensionStaticField#isSet = true;
self::_#Extension|extensionStaticField = #t36;
}
@#C1
static get Extension|finalExtensionStaticField() → core::int
return let final core::int? #t37 = self::_#Extension|finalExtensionStaticField in #t37.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticField' has not been initialized.") : #t37{core::int};
return self::_#Extension|finalExtensionStaticField#isSet ?{core::int} let final core::int? #t37 = self::_#Extension|finalExtensionStaticField in #t37{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticField' has not been initialized.");
@#C1
static set Extension|finalExtensionStaticField(core::int #t38) → void
if(self::_#Extension|finalExtensionStaticField.==(null))
self::_#Extension|finalExtensionStaticField = #t38;
else
if(self::_#Extension|finalExtensionStaticField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticField' has already been initialized.");
else {
self::_#Extension|finalExtensionStaticField#isSet = true;
self::_#Extension|finalExtensionStaticField = #t38;
}
@#C1
static get Extension|finalExtensionStaticFieldWithInitializer() → core::int
return let final core::int? #t39 = self::_#Extension|finalExtensionStaticFieldWithInitializer in #t39.==(null) ?{core::int} let final core::int #t40 = 0 in self::_#Extension|finalExtensionStaticFieldWithInitializer.==(null) ?{core::int} self::_#Extension|finalExtensionStaticFieldWithInitializer = #t40 : throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticFieldWithInitializer' has been assigned during initialization.") : #t39{core::int};

View file

@ -10,158 +10,209 @@ class Annotation extends core::Object /*hasConstConstructor*/ {
}
class A extends core::Object {
field core::int? _#A#instanceField = null;
field core::bool _#A#instanceField#isSet = false;
field core::int? _#A#finalInstanceField = null;
field core::bool _#A#finalInstanceField#isSet = false;
field core::int? _#A#finalInstanceFieldWithInitializer = null;
field core::bool _#A#finalInstanceFieldWithInitializer#isSet = false;
field core::num? _#A#covariantInstanceField = null;
field core::bool _#A#covariantInstanceField#isSet = false;
static field core::int? _#staticField = null;
static field core::bool _#staticField#isSet = false;
static field core::int? _#finalStaticField = null;
static field core::bool _#finalStaticField#isSet = false;
static field core::int? _#finalStaticFieldWithInitializer = null;
static field core::bool _#finalStaticFieldWithInitializer#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
@#C1
get instanceField() → core::int
return let final core::int? #t1 = this.{self::A::_#A#instanceField} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.") : #t1{core::int};
return this.{self::A::_#A#instanceField#isSet} ?{core::int} let final core::int? #t1 = this.{self::A::_#A#instanceField} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.");
@#C1
set instanceField(core::int #t2) → void
set instanceField(core::int #t2) → void {
this.{self::A::_#A#instanceField#isSet} = true;
this.{self::A::_#A#instanceField} = #t2;
}
@#C1
get finalInstanceField() → core::int
return let final core::int? #t3 = this.{self::A::_#A#finalInstanceField} in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.") : #t3{core::int};
return this.{self::A::_#A#finalInstanceField#isSet} ?{core::int} let final core::int? #t3 = this.{self::A::_#A#finalInstanceField} in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
@#C1
set finalInstanceField(core::int #t4) → void
if(this.{self::A::_#A#finalInstanceField}.==(null))
this.{self::A::_#A#finalInstanceField} = #t4;
else
if(this.{self::A::_#A#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{self::A::_#A#finalInstanceField#isSet} = true;
this.{self::A::_#A#finalInstanceField} = #t4;
}
@#C1
get finalInstanceFieldWithInitializer() → core::int
return let final core::int? #t5 = this.{self::A::_#A#finalInstanceFieldWithInitializer} in #t5.==(null) ?{core::int} let final core::int #t6 = 0 in this.{self::A::_#A#finalInstanceFieldWithInitializer}.==(null) ?{core::int} this.{self::A::_#A#finalInstanceFieldWithInitializer} = #t6 : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceFieldWithInitializer' has been assigned during initialization.") : #t5{core::int};
@#C1
get covariantInstanceField() → core::num
return let final core::num? #t7 = this.{self::A::_#A#covariantInstanceField} in #t7.==(null) ?{core::num} throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.") : #t7{core::num};
return this.{self::A::_#A#covariantInstanceField#isSet} ?{core::num} let final core::num? #t7 = this.{self::A::_#A#covariantInstanceField} in #t7{core::num} : throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.");
@#C1
set covariantInstanceField(covariant core::num #t8) → void
set covariantInstanceField(covariant core::num #t8) → void {
this.{self::A::_#A#covariantInstanceField#isSet} = true;
this.{self::A::_#A#covariantInstanceField} = #t8;
}
@#C1
static get staticField() → core::int
return let final core::int? #t9 = self::A::_#staticField in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.") : #t9{core::int};
return self::A::_#staticField#isSet ?{core::int} let final core::int? #t9 = self::A::_#staticField in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.");
@#C1
static set staticField(core::int #t10) → void
static set staticField(core::int #t10) → void {
self::A::_#staticField#isSet = true;
self::A::_#staticField = #t10;
}
@#C1
static get finalStaticField() → core::int
return let final core::int? #t11 = self::A::_#finalStaticField in #t11.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.") : #t11{core::int};
return self::A::_#finalStaticField#isSet ?{core::int} let final core::int? #t11 = self::A::_#finalStaticField in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.");
@#C1
static set finalStaticField(core::int #t12) → void
if(self::A::_#finalStaticField.==(null))
self::A::_#finalStaticField = #t12;
else
if(self::A::_#finalStaticField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has already been initialized.");
else {
self::A::_#finalStaticField#isSet = true;
self::A::_#finalStaticField = #t12;
}
@#C1
static get finalStaticFieldWithInitializer() → core::int
return let final core::int? #t13 = self::A::_#finalStaticFieldWithInitializer in #t13.==(null) ?{core::int} let final core::int #t14 = 0 in self::A::_#finalStaticFieldWithInitializer.==(null) ?{core::int} self::A::_#finalStaticFieldWithInitializer = #t14 : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticFieldWithInitializer' has been assigned during initialization.") : #t13{core::int};
}
abstract class B extends core::Object /*isMixinDeclaration*/ {
field core::int? _#B#instanceField = null;
field core::bool _#B#instanceField#isSet = false;
field core::int? _#B#finalInstanceField = null;
field core::bool _#B#finalInstanceField#isSet = false;
field core::int? _#B#finalInstanceFieldWithInitializer = null;
field core::bool _#B#finalInstanceFieldWithInitializer#isSet = false;
field core::num? _#B#covariantInstanceField = null;
field core::bool _#B#covariantInstanceField#isSet = false;
static field core::int? _#staticField = null;
static field core::bool _#staticField#isSet = false;
static field core::int? _#finalStaticField = null;
static field core::bool _#finalStaticField#isSet = false;
static field core::int? _#finalStaticFieldWithInitializer = null;
static field core::bool _#finalStaticFieldWithInitializer#isSet = false;
@#C1
get instanceField() → core::int
return let final core::int? #t15 = this.{self::B::_#B#instanceField} in #t15.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.") : #t15{core::int};
return this.{self::B::_#B#instanceField#isSet} ?{core::int} let final core::int? #t15 = this.{self::B::_#B#instanceField} in #t15{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.");
@#C1
set instanceField(core::int #t16) → void
set instanceField(core::int #t16) → void {
this.{self::B::_#B#instanceField#isSet} = true;
this.{self::B::_#B#instanceField} = #t16;
}
@#C1
get finalInstanceField() → core::int
return let final core::int? #t17 = this.{self::B::_#B#finalInstanceField} in #t17.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.") : #t17{core::int};
return this.{self::B::_#B#finalInstanceField#isSet} ?{core::int} let final core::int? #t17 = this.{self::B::_#B#finalInstanceField} in #t17{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
@#C1
set finalInstanceField(core::int #t18) → void
if(this.{self::B::_#B#finalInstanceField}.==(null))
this.{self::B::_#B#finalInstanceField} = #t18;
else
if(this.{self::B::_#B#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{self::B::_#B#finalInstanceField#isSet} = true;
this.{self::B::_#B#finalInstanceField} = #t18;
}
@#C1
get finalInstanceFieldWithInitializer() → core::int
return let final core::int? #t19 = this.{self::B::_#B#finalInstanceFieldWithInitializer} in #t19.==(null) ?{core::int} let final core::int #t20 = 0 in this.{self::B::_#B#finalInstanceFieldWithInitializer}.==(null) ?{core::int} this.{self::B::_#B#finalInstanceFieldWithInitializer} = #t20 : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceFieldWithInitializer' has been assigned during initialization.") : #t19{core::int};
@#C1
get covariantInstanceField() → core::num
return let final core::num? #t21 = this.{self::B::_#B#covariantInstanceField} in #t21.==(null) ?{core::num} throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.") : #t21{core::num};
return this.{self::B::_#B#covariantInstanceField#isSet} ?{core::num} let final core::num? #t21 = this.{self::B::_#B#covariantInstanceField} in #t21{core::num} : throw new _in::LateInitializationErrorImpl::•("Field 'covariantInstanceField' has not been initialized.");
@#C1
set covariantInstanceField(covariant core::num #t22) → void
set covariantInstanceField(covariant core::num #t22) → void {
this.{self::B::_#B#covariantInstanceField#isSet} = true;
this.{self::B::_#B#covariantInstanceField} = #t22;
}
@#C1
static get staticField() → core::int
return let final core::int? #t23 = self::B::_#staticField in #t23.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.") : #t23{core::int};
return self::B::_#staticField#isSet ?{core::int} let final core::int? #t23 = self::B::_#staticField in #t23{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.");
@#C1
static set staticField(core::int #t24) → void
static set staticField(core::int #t24) → void {
self::B::_#staticField#isSet = true;
self::B::_#staticField = #t24;
}
@#C1
static get finalStaticField() → core::int
return let final core::int? #t25 = self::B::_#finalStaticField in #t25.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.") : #t25{core::int};
return self::B::_#finalStaticField#isSet ?{core::int} let final core::int? #t25 = self::B::_#finalStaticField in #t25{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has not been initialized.");
@#C1
static set finalStaticField(core::int #t26) → void
if(self::B::_#finalStaticField.==(null))
self::B::_#finalStaticField = #t26;
else
if(self::B::_#finalStaticField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticField' has already been initialized.");
else {
self::B::_#finalStaticField#isSet = true;
self::B::_#finalStaticField = #t26;
}
@#C1
static get finalStaticFieldWithInitializer() → core::int
return let final core::int? #t27 = self::B::_#finalStaticFieldWithInitializer in #t27.==(null) ?{core::int} let final core::int #t28 = 0 in self::B::_#finalStaticFieldWithInitializer.==(null) ?{core::int} self::B::_#finalStaticFieldWithInitializer = #t28 : throw new _in::LateInitializationErrorImpl::•("Field 'finalStaticFieldWithInitializer' has been assigned during initialization.") : #t27{core::int};
}
extension Extension on self::A {
static field extensionStaticField = self::_#Extension|extensionStaticField;
static field extensionStaticField = self::_#Extension|extensionStaticField#isSet;
static get extensionStaticField = get self::Extension|extensionStaticField;
static set extensionStaticField = set self::Extension|extensionStaticField;
static field finalExtensionStaticField = self::_#Extension|finalExtensionStaticField;
static field finalExtensionStaticField = self::_#Extension|finalExtensionStaticField#isSet;
static get finalExtensionStaticField = get self::Extension|finalExtensionStaticField;
static set finalExtensionStaticField = set self::Extension|finalExtensionStaticField;
static field finalExtensionStaticFieldWithInitializer = self::_#Extension|finalExtensionStaticFieldWithInitializer;
static field finalExtensionStaticFieldWithInitializer = self::_#Extension|finalExtensionStaticFieldWithInitializer#isSet;
static get finalExtensionStaticFieldWithInitializer = get self::Extension|finalExtensionStaticFieldWithInitializer;
}
static field core::int? _#topLevelField = null;
static field core::bool _#topLevelField#isSet = false;
static field core::int? _#finalTopLevelField = null;
static field core::bool _#finalTopLevelField#isSet = false;
static field core::int? _#finalTopLevelFieldWithInitializer = null;
static field core::bool _#finalTopLevelFieldWithInitializer#isSet = false;
static field core::int? _#Extension|extensionStaticField = null;
static field core::bool _#Extension|extensionStaticField#isSet = false;
static field core::int? _#Extension|finalExtensionStaticField = null;
static field core::bool _#Extension|finalExtensionStaticField#isSet = false;
static field core::int? _#Extension|finalExtensionStaticFieldWithInitializer = null;
static field core::bool _#Extension|finalExtensionStaticFieldWithInitializer#isSet = false;
@#C1
static get topLevelField() → core::int
return let final core::int? #t29 = self::_#topLevelField in #t29.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.") : #t29{core::int};
return self::_#topLevelField#isSet ?{core::int} let final core::int? #t29 = self::_#topLevelField in #t29{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.");
@#C1
static set topLevelField(core::int #t30) → void
static set topLevelField(core::int #t30) → void {
self::_#topLevelField#isSet = true;
self::_#topLevelField = #t30;
}
@#C1
static get finalTopLevelField() → core::int
return let final core::int? #t31 = self::_#finalTopLevelField in #t31.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.") : #t31{core::int};
return self::_#finalTopLevelField#isSet ?{core::int} let final core::int? #t31 = self::_#finalTopLevelField in #t31{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.");
@#C1
static set finalTopLevelField(core::int #t32) → void
if(self::_#finalTopLevelField.==(null))
self::_#finalTopLevelField = #t32;
else
if(self::_#finalTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has already been initialized.");
else {
self::_#finalTopLevelField#isSet = true;
self::_#finalTopLevelField = #t32;
}
@#C1
static get finalTopLevelFieldWithInitializer() → core::int
return let final core::int? #t33 = self::_#finalTopLevelFieldWithInitializer in #t33.==(null) ?{core::int} let final core::int #t34 = 0 in self::_#finalTopLevelFieldWithInitializer.==(null) ?{core::int} self::_#finalTopLevelFieldWithInitializer = #t34 : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelFieldWithInitializer' has been assigned during initialization.") : #t33{core::int};
@#C1
static get Extension|extensionStaticField() → core::int
return let final core::int? #t35 = self::_#Extension|extensionStaticField in #t35.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'extensionStaticField' has not been initialized.") : #t35{core::int};
return self::_#Extension|extensionStaticField#isSet ?{core::int} let final core::int? #t35 = self::_#Extension|extensionStaticField in #t35{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'extensionStaticField' has not been initialized.");
@#C1
static set Extension|extensionStaticField(core::int #t36) → void
static set Extension|extensionStaticField(core::int #t36) → void {
self::_#Extension|extensionStaticField#isSet = true;
self::_#Extension|extensionStaticField = #t36;
}
@#C1
static get Extension|finalExtensionStaticField() → core::int
return let final core::int? #t37 = self::_#Extension|finalExtensionStaticField in #t37.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticField' has not been initialized.") : #t37{core::int};
return self::_#Extension|finalExtensionStaticField#isSet ?{core::int} let final core::int? #t37 = self::_#Extension|finalExtensionStaticField in #t37{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticField' has not been initialized.");
@#C1
static set Extension|finalExtensionStaticField(core::int #t38) → void
if(self::_#Extension|finalExtensionStaticField.==(null))
self::_#Extension|finalExtensionStaticField = #t38;
else
if(self::_#Extension|finalExtensionStaticField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticField' has already been initialized.");
else {
self::_#Extension|finalExtensionStaticField#isSet = true;
self::_#Extension|finalExtensionStaticField = #t38;
}
@#C1
static get Extension|finalExtensionStaticFieldWithInitializer() → core::int
return let final core::int? #t39 = self::_#Extension|finalExtensionStaticFieldWithInitializer in #t39.==(null) ?{core::int} let final core::int #t40 = 0 in self::_#Extension|finalExtensionStaticFieldWithInitializer.==(null) ?{core::int} self::_#Extension|finalExtensionStaticFieldWithInitializer = #t40 : throw new _in::LateInitializationErrorImpl::•("Field 'finalExtensionStaticFieldWithInitializer' has been assigned during initialization.") : #t39{core::int};

View file

@ -14,10 +14,17 @@ class A extends core::Object {
synthetic constructor •() → self::A
: super core::Object::•()
;
get nonNullableInstanceField() → core::int
return let final core::int? #t1 = this.{self::A::_#A#nonNullableInstanceField} in #t1.==(null) ?{core::int} this.{self::A::_#A#nonNullableInstanceField} = 0 : #t1{core::int};
set nonNullableInstanceField(core::int #t2) → void
get nonNullableInstanceField() → core::int {
if(!this.{self::A::_#A#nonNullableInstanceField#isSet}) {
this.{self::A::_#A#nonNullableInstanceField} = 0;
this.{self::A::_#A#nonNullableInstanceField#isSet} = true;
}
return let final core::int? #t1 = this.{self::A::_#A#nonNullableInstanceField} in #t1{core::int};
}
set nonNullableInstanceField(core::int #t2) → void {
this.{self::A::_#A#nonNullableInstanceField#isSet} = true;
this.{self::A::_#A#nonNullableInstanceField} = #t2;
}
get nullableInstanceField() → core::int? {
if(!this.{self::A::_#A#nullableInstanceField#isSet}) {
this.{self::A::_#A#nullableInstanceField} = self::method();
@ -29,10 +36,17 @@ class A extends core::Object {
this.{self::A::_#A#nullableInstanceField#isSet} = true;
this.{self::A::_#A#nullableInstanceField} = #t3;
}
static get nonNullableStaticField() → core::int
return let final core::int? #t4 = self::A::_#nonNullableStaticField in #t4.==(null) ?{core::int} self::A::_#nonNullableStaticField = 0 : #t4{core::int};
static set nonNullableStaticField(core::int #t5) → void
static get nonNullableStaticField() → core::int {
if(!self::A::_#nonNullableStaticField#isSet) {
self::A::_#nonNullableStaticField = 0;
self::A::_#nonNullableStaticField#isSet = true;
}
return let final core::int? #t4 = self::A::_#nonNullableStaticField in #t4{core::int};
}
static set nonNullableStaticField(core::int #t5) → void {
self::A::_#nonNullableStaticField#isSet = true;
self::A::_#nonNullableStaticField = #t5;
}
static get nullableStaticField() → core::int? {
if(!self::A::_#nullableStaticField#isSet) {
self::A::_#nullableStaticField = self::method();
@ -62,10 +76,17 @@ static field core::int? _#nullableTopLevelField = null;
static field core::bool _#nullableTopLevelField#isSet = false;
static method method() → core::int?
return null;
static get nonNullableTopLevelField() → core::int
return let final core::int? #t7 = self::_#nonNullableTopLevelField in #t7.==(null) ?{core::int} self::_#nonNullableTopLevelField = 0 : #t7{core::int};
static set nonNullableTopLevelField(core::int #t8) → void
static get nonNullableTopLevelField() → core::int {
if(!self::_#nonNullableTopLevelField#isSet) {
self::_#nonNullableTopLevelField = 0;
self::_#nonNullableTopLevelField#isSet = true;
}
return let final core::int? #t7 = self::_#nonNullableTopLevelField in #t7{core::int};
}
static set nonNullableTopLevelField(core::int #t8) → void {
self::_#nonNullableTopLevelField#isSet = true;
self::_#nonNullableTopLevelField = #t8;
}
static get nullableTopLevelField() → core::int? {
if(!self::_#nullableTopLevelField#isSet) {
self::_#nullableTopLevelField = self::method();

View file

@ -14,10 +14,17 @@ class A extends core::Object {
synthetic constructor •() → self::A
: super core::Object::•()
;
get nonNullableInstanceField() → core::int
return let final core::int? #t1 = this.{self::A::_#A#nonNullableInstanceField} in #t1.==(null) ?{core::int} this.{self::A::_#A#nonNullableInstanceField} = 0 : #t1{core::int};
set nonNullableInstanceField(core::int #t2) → void
get nonNullableInstanceField() → core::int {
if(!this.{self::A::_#A#nonNullableInstanceField#isSet}) {
this.{self::A::_#A#nonNullableInstanceField} = 0;
this.{self::A::_#A#nonNullableInstanceField#isSet} = true;
}
return let final core::int? #t1 = this.{self::A::_#A#nonNullableInstanceField} in #t1{core::int};
}
set nonNullableInstanceField(core::int #t2) → void {
this.{self::A::_#A#nonNullableInstanceField#isSet} = true;
this.{self::A::_#A#nonNullableInstanceField} = #t2;
}
get nullableInstanceField() → core::int? {
if(!this.{self::A::_#A#nullableInstanceField#isSet}) {
this.{self::A::_#A#nullableInstanceField} = self::method();
@ -29,10 +36,17 @@ class A extends core::Object {
this.{self::A::_#A#nullableInstanceField#isSet} = true;
this.{self::A::_#A#nullableInstanceField} = #t3;
}
static get nonNullableStaticField() → core::int
return let final core::int? #t4 = self::A::_#nonNullableStaticField in #t4.==(null) ?{core::int} self::A::_#nonNullableStaticField = 0 : #t4{core::int};
static set nonNullableStaticField(core::int #t5) → void
static get nonNullableStaticField() → core::int {
if(!self::A::_#nonNullableStaticField#isSet) {
self::A::_#nonNullableStaticField = 0;
self::A::_#nonNullableStaticField#isSet = true;
}
return let final core::int? #t4 = self::A::_#nonNullableStaticField in #t4{core::int};
}
static set nonNullableStaticField(core::int #t5) → void {
self::A::_#nonNullableStaticField#isSet = true;
self::A::_#nonNullableStaticField = #t5;
}
static get nullableStaticField() → core::int? {
if(!self::A::_#nullableStaticField#isSet) {
self::A::_#nullableStaticField = self::method();
@ -62,10 +76,17 @@ static field core::int? _#nullableTopLevelField = null;
static field core::bool _#nullableTopLevelField#isSet = false;
static method method() → core::int?
return null;
static get nonNullableTopLevelField() → core::int
return let final core::int? #t7 = self::_#nonNullableTopLevelField in #t7.==(null) ?{core::int} self::_#nonNullableTopLevelField = 0 : #t7{core::int};
static set nonNullableTopLevelField(core::int #t8) → void
static get nonNullableTopLevelField() → core::int {
if(!self::_#nonNullableTopLevelField#isSet) {
self::_#nonNullableTopLevelField = 0;
self::_#nonNullableTopLevelField#isSet = true;
}
return let final core::int? #t7 = self::_#nonNullableTopLevelField in #t7{core::int};
}
static set nonNullableTopLevelField(core::int #t8) → void {
self::_#nonNullableTopLevelField#isSet = true;
self::_#nonNullableTopLevelField = #t8;
}
static get nullableTopLevelField() → core::int? {
if(!self::_#nullableTopLevelField#isSet) {
self::_#nullableTopLevelField = self::method();

View file

@ -4,8 +4,11 @@ import "dart:core" as core;
class Class<T extends core::Object? = dynamic> extends core::Object {
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
final field self::Class::T% field;
generic-covariant-impl field self::Class::T? _#Class#lateGenericField1 = null;
field core::bool _#Class#lateGenericField1#isSet = false;
@ -14,23 +17,44 @@ class Class<T extends core::Object? = dynamic> extends core::Object {
constructor •(self::Class::T% field) → self::Class<self::Class::T%>
: self::Class::field = field, super core::Object::•()
;
static get lateStaticField1() → core::int
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1.==(null) ?{core::int} self::Class::_#lateStaticField1 = 87 : #t1{core::int};
static set lateStaticField1(core::int #t2) → void
static get lateStaticField1() → core::int {
if(!self::Class::_#lateStaticField1#isSet) {
self::Class::_#lateStaticField1 = 87;
self::Class::_#lateStaticField1#isSet = true;
}
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1{core::int};
}
static set lateStaticField1(core::int #t2) → void {
self::Class::_#lateStaticField1#isSet = true;
self::Class::_#lateStaticField1 = #t2;
static get lateStaticField2() → core::int
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3.==(null) ?{core::int} self::Class::_#lateStaticField2 = 42 : #t3{core::int};
static set lateStaticField2(core::int #t4) → void
}
static get lateStaticField2() → core::int {
if(!self::Class::_#lateStaticField2#isSet) {
self::Class::_#lateStaticField2 = 42;
self::Class::_#lateStaticField2#isSet = true;
}
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3{core::int};
}
static set lateStaticField2(core::int #t4) → void {
self::Class::_#lateStaticField2#isSet = true;
self::Class::_#lateStaticField2 = #t4;
}
static method staticMethod() → dynamic {
self::expect(42, self::Class::lateStaticField2);
self::Class::lateStaticField2 = 43;
self::expect(43, self::Class::lateStaticField2);
}
get lateInstanceField() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5.==(null) ?{core::int} this.{self::Class::_#Class#lateInstanceField} = 16 : #t5{core::int};
set lateInstanceField(core::int #t6) → void
get lateInstanceField() → core::int {
if(!this.{self::Class::_#Class#lateInstanceField#isSet}) {
this.{self::Class::_#Class#lateInstanceField} = 16;
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
}
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5{core::int};
}
set lateInstanceField(core::int #t6) → void {
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
this.{self::Class::_#Class#lateInstanceField} = #t6;
}
get lateGenericField1() → self::Class::T% {
if(!this.{self::Class::_#Class#lateGenericField1#isSet}) {
this.{self::Class::_#Class#lateGenericField1} = this.{self::Class::field};
@ -66,28 +90,54 @@ class Class<T extends core::Object? = dynamic> extends core::Object {
}
extension Extension<T extends core::Object? = dynamic> on self::Class<T%> {
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static set lateExtensionField1 = set self::Extension|lateExtensionField1;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static set lateExtensionField2 = set self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? _#lateTopLevelField1 = null;
static field core::bool _#lateTopLevelField1#isSet = false;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? _#Extension|lateExtensionField2 = null;
static get lateTopLevelField1() → core::int
return let final core::int? #t11 = self::_#lateTopLevelField1 in #t11.==(null) ?{core::int} self::_#lateTopLevelField1 = 123 : #t11{core::int};
static set lateTopLevelField1(core::int #t12) → void
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static get lateTopLevelField1() → core::int {
if(!self::_#lateTopLevelField1#isSet) {
self::_#lateTopLevelField1 = 123;
self::_#lateTopLevelField1#isSet = true;
}
return let final core::int? #t11 = self::_#lateTopLevelField1 in #t11{core::int};
}
static set lateTopLevelField1(core::int #t12) → void {
self::_#lateTopLevelField1#isSet = true;
self::_#lateTopLevelField1 = #t12;
static get Extension|lateExtensionField1() → core::int
return let final core::int? #t13 = self::_#Extension|lateExtensionField1 in #t13.==(null) ?{core::int} self::_#Extension|lateExtensionField1 = 87 : #t13{core::int};
static set Extension|lateExtensionField1(core::int #t14) → void
}
static get Extension|lateExtensionField1() → core::int {
if(!self::_#Extension|lateExtensionField1#isSet) {
self::_#Extension|lateExtensionField1 = 87;
self::_#Extension|lateExtensionField1#isSet = true;
}
return let final core::int? #t13 = self::_#Extension|lateExtensionField1 in #t13{core::int};
}
static set Extension|lateExtensionField1(core::int #t14) → void {
self::_#Extension|lateExtensionField1#isSet = true;
self::_#Extension|lateExtensionField1 = #t14;
static get Extension|lateExtensionField2() → core::int
return let final core::int? #t15 = self::_#Extension|lateExtensionField2 in #t15.==(null) ?{core::int} self::_#Extension|lateExtensionField2 = 42 : #t15{core::int};
static set Extension|lateExtensionField2(core::int #t16) → void
}
static get Extension|lateExtensionField2() → core::int {
if(!self::_#Extension|lateExtensionField2#isSet) {
self::_#Extension|lateExtensionField2 = 42;
self::_#Extension|lateExtensionField2#isSet = true;
}
return let final core::int? #t15 = self::_#Extension|lateExtensionField2 in #t15{core::int};
}
static set Extension|lateExtensionField2(core::int #t16) → void {
self::_#Extension|lateExtensionField2#isSet = true;
self::_#Extension|lateExtensionField2 = #t16;
}
static method Extension|staticMethod() → dynamic {
self::expect(42, self::Extension|lateExtensionField2);
self::Extension|lateExtensionField2 = 43;

View file

@ -4,8 +4,11 @@ import "dart:core" as core;
class Class<T extends core::Object? = dynamic> extends core::Object {
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
final field self::Class::T% field;
generic-covariant-impl field self::Class::T? _#Class#lateGenericField1 = null;
field core::bool _#Class#lateGenericField1#isSet = false;
@ -14,23 +17,44 @@ class Class<T extends core::Object? = dynamic> extends core::Object {
constructor •(self::Class::T% field) → self::Class<self::Class::T%>
: self::Class::field = field, super core::Object::•()
;
static get lateStaticField1() → core::int
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1.==(null) ?{core::int} self::Class::_#lateStaticField1 = 87 : #t1{core::int};
static set lateStaticField1(core::int #t2) → void
static get lateStaticField1() → core::int {
if(!self::Class::_#lateStaticField1#isSet) {
self::Class::_#lateStaticField1 = 87;
self::Class::_#lateStaticField1#isSet = true;
}
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1{core::int};
}
static set lateStaticField1(core::int #t2) → void {
self::Class::_#lateStaticField1#isSet = true;
self::Class::_#lateStaticField1 = #t2;
static get lateStaticField2() → core::int
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3.==(null) ?{core::int} self::Class::_#lateStaticField2 = 42 : #t3{core::int};
static set lateStaticField2(core::int #t4) → void
}
static get lateStaticField2() → core::int {
if(!self::Class::_#lateStaticField2#isSet) {
self::Class::_#lateStaticField2 = 42;
self::Class::_#lateStaticField2#isSet = true;
}
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3{core::int};
}
static set lateStaticField2(core::int #t4) → void {
self::Class::_#lateStaticField2#isSet = true;
self::Class::_#lateStaticField2 = #t4;
}
static method staticMethod() → dynamic {
self::expect(42, self::Class::lateStaticField2);
self::Class::lateStaticField2 = 43;
self::expect(43, self::Class::lateStaticField2);
}
get lateInstanceField() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5.==(null) ?{core::int} this.{self::Class::_#Class#lateInstanceField} = 16 : #t5{core::int};
set lateInstanceField(core::int #t6) → void
get lateInstanceField() → core::int {
if(!this.{self::Class::_#Class#lateInstanceField#isSet}) {
this.{self::Class::_#Class#lateInstanceField} = 16;
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
}
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5{core::int};
}
set lateInstanceField(core::int #t6) → void {
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
this.{self::Class::_#Class#lateInstanceField} = #t6;
}
get lateGenericField1() → self::Class::T% {
if(!this.{self::Class::_#Class#lateGenericField1#isSet}) {
this.{self::Class::_#Class#lateGenericField1} = this.{self::Class::field};
@ -66,28 +90,54 @@ class Class<T extends core::Object? = dynamic> extends core::Object {
}
extension Extension<T extends core::Object? = dynamic> on self::Class<T%> {
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static set lateExtensionField1 = set self::Extension|lateExtensionField1;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static set lateExtensionField2 = set self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? _#lateTopLevelField1 = null;
static field core::bool _#lateTopLevelField1#isSet = false;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? _#Extension|lateExtensionField2 = null;
static get lateTopLevelField1() → core::int
return let final core::int? #t11 = self::_#lateTopLevelField1 in #t11.==(null) ?{core::int} self::_#lateTopLevelField1 = 123 : #t11{core::int};
static set lateTopLevelField1(core::int #t12) → void
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static get lateTopLevelField1() → core::int {
if(!self::_#lateTopLevelField1#isSet) {
self::_#lateTopLevelField1 = 123;
self::_#lateTopLevelField1#isSet = true;
}
return let final core::int? #t11 = self::_#lateTopLevelField1 in #t11{core::int};
}
static set lateTopLevelField1(core::int #t12) → void {
self::_#lateTopLevelField1#isSet = true;
self::_#lateTopLevelField1 = #t12;
static get Extension|lateExtensionField1() → core::int
return let final core::int? #t13 = self::_#Extension|lateExtensionField1 in #t13.==(null) ?{core::int} self::_#Extension|lateExtensionField1 = 87 : #t13{core::int};
static set Extension|lateExtensionField1(core::int #t14) → void
}
static get Extension|lateExtensionField1() → core::int {
if(!self::_#Extension|lateExtensionField1#isSet) {
self::_#Extension|lateExtensionField1 = 87;
self::_#Extension|lateExtensionField1#isSet = true;
}
return let final core::int? #t13 = self::_#Extension|lateExtensionField1 in #t13{core::int};
}
static set Extension|lateExtensionField1(core::int #t14) → void {
self::_#Extension|lateExtensionField1#isSet = true;
self::_#Extension|lateExtensionField1 = #t14;
static get Extension|lateExtensionField2() → core::int
return let final core::int? #t15 = self::_#Extension|lateExtensionField2 in #t15.==(null) ?{core::int} self::_#Extension|lateExtensionField2 = 42 : #t15{core::int};
static set Extension|lateExtensionField2(core::int #t16) → void
}
static get Extension|lateExtensionField2() → core::int {
if(!self::_#Extension|lateExtensionField2#isSet) {
self::_#Extension|lateExtensionField2 = 42;
self::_#Extension|lateExtensionField2#isSet = true;
}
return let final core::int? #t15 = self::_#Extension|lateExtensionField2 in #t15{core::int};
}
static set Extension|lateExtensionField2(core::int #t16) → void {
self::_#Extension|lateExtensionField2#isSet = true;
self::_#Extension|lateExtensionField2 = #t16;
}
static method Extension|staticMethod() → dynamic {
self::expect(42, self::Extension|lateExtensionField2);
self::Extension|lateExtensionField2 = 43;

View file

@ -5,30 +5,39 @@ import "dart:_internal" as _in;
class Class<T extends core::Object? = dynamic> extends core::Object {
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
generic-covariant-impl field self::Class::T? _#Class#lateGenericInstanceField = null;
field core::bool _#Class#lateGenericInstanceField#isSet = false;
synthetic constructor •() → self::Class<self::Class::T%>
: super core::Object::•()
;
static get lateStaticField1() → core::int
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.") : #t1{core::int};
static set lateStaticField1(core::int #t2) → void
return self::Class::_#lateStaticField1#isSet ?{core::int} let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.");
static set lateStaticField1(core::int #t2) → void {
self::Class::_#lateStaticField1#isSet = true;
self::Class::_#lateStaticField1 = #t2;
}
static get lateStaticField2() → core::int
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.") : #t3{core::int};
static set lateStaticField2(core::int #t4) → void
return self::Class::_#lateStaticField2#isSet ?{core::int} let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.");
static set lateStaticField2(core::int #t4) → void {
self::Class::_#lateStaticField2#isSet = true;
self::Class::_#lateStaticField2 = #t4;
}
static method staticMethod() → dynamic {
self::throws(() → core::int => self::Class::lateStaticField2, "Read value from uninitialized Class.lateStaticField2");
self::Class::lateStaticField2 = 42;
self::expect(42, self::Class::lateStaticField2);
}
get lateInstanceField() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.") : #t5{core::int};
set lateInstanceField(core::int #t6) → void
return this.{self::Class::_#Class#lateInstanceField#isSet} ?{core::int} let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.");
set lateInstanceField(core::int #t6) → void {
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
this.{self::Class::_#Class#lateInstanceField} = #t6;
}
get lateGenericInstanceField() → self::Class::T%
return this.{self::Class::_#Class#lateGenericInstanceField#isSet} ?{self::Class::T%} let final self::Class::T? #t7 = this.{self::Class::_#Class#lateGenericInstanceField} in #t7{self::Class::T%} : throw new _in::LateInitializationErrorImpl::•("Field 'lateGenericInstanceField' has not been initialized.");
set lateGenericInstanceField(generic-covariant-impl self::Class::T% #t8) → void {
@ -46,28 +55,39 @@ class Class<T extends core::Object? = dynamic> extends core::Object {
}
extension Extension<T extends core::Object? = dynamic> on self::Class<T%> {
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static set lateExtensionField1 = set self::Extension|lateExtensionField1;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static set lateExtensionField2 = set self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? _#lateTopLevelField = null;
static field core::bool _#lateTopLevelField#isSet = false;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? _#Extension|lateExtensionField2 = null;
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static get lateTopLevelField() → core::int
return let final core::int? #t9 = self::_#lateTopLevelField in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.") : #t9{core::int};
static set lateTopLevelField(core::int #t10) → void
return self::_#lateTopLevelField#isSet ?{core::int} let final core::int? #t9 = self::_#lateTopLevelField in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.");
static set lateTopLevelField(core::int #t10) → void {
self::_#lateTopLevelField#isSet = true;
self::_#lateTopLevelField = #t10;
}
static get Extension|lateExtensionField1() → core::int
return let final core::int? #t11 = self::_#Extension|lateExtensionField1 in #t11.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.") : #t11{core::int};
static set Extension|lateExtensionField1(core::int #t12) → void
return self::_#Extension|lateExtensionField1#isSet ?{core::int} let final core::int? #t11 = self::_#Extension|lateExtensionField1 in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.");
static set Extension|lateExtensionField1(core::int #t12) → void {
self::_#Extension|lateExtensionField1#isSet = true;
self::_#Extension|lateExtensionField1 = #t12;
}
static get Extension|lateExtensionField2() → core::int
return let final core::int? #t13 = self::_#Extension|lateExtensionField2 in #t13.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.") : #t13{core::int};
static set Extension|lateExtensionField2(core::int #t14) → void
return self::_#Extension|lateExtensionField2#isSet ?{core::int} let final core::int? #t13 = self::_#Extension|lateExtensionField2 in #t13{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.");
static set Extension|lateExtensionField2(core::int #t14) → void {
self::_#Extension|lateExtensionField2#isSet = true;
self::_#Extension|lateExtensionField2 = #t14;
}
static method Extension|staticMethod() → dynamic {
self::throws(() → core::int => self::Extension|lateExtensionField2, "Read value from uninitialized Class.lateExtensionField2");
self::Extension|lateExtensionField2 = 42;

View file

@ -5,30 +5,39 @@ import "dart:_internal" as _in;
class Class<T extends core::Object? = dynamic> extends core::Object {
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
generic-covariant-impl field self::Class::T? _#Class#lateGenericInstanceField = null;
field core::bool _#Class#lateGenericInstanceField#isSet = false;
synthetic constructor •() → self::Class<self::Class::T%>
: super core::Object::•()
;
static get lateStaticField1() → core::int
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.") : #t1{core::int};
static set lateStaticField1(core::int #t2) → void
return self::Class::_#lateStaticField1#isSet ?{core::int} let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.");
static set lateStaticField1(core::int #t2) → void {
self::Class::_#lateStaticField1#isSet = true;
self::Class::_#lateStaticField1 = #t2;
}
static get lateStaticField2() → core::int
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.") : #t3{core::int};
static set lateStaticField2(core::int #t4) → void
return self::Class::_#lateStaticField2#isSet ?{core::int} let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.");
static set lateStaticField2(core::int #t4) → void {
self::Class::_#lateStaticField2#isSet = true;
self::Class::_#lateStaticField2 = #t4;
}
static method staticMethod() → dynamic {
self::throws(() → core::int => self::Class::lateStaticField2, "Read value from uninitialized Class.lateStaticField2");
self::Class::lateStaticField2 = 42;
self::expect(42, self::Class::lateStaticField2);
}
get lateInstanceField() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.") : #t5{core::int};
set lateInstanceField(core::int #t6) → void
return this.{self::Class::_#Class#lateInstanceField#isSet} ?{core::int} let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.");
set lateInstanceField(core::int #t6) → void {
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
this.{self::Class::_#Class#lateInstanceField} = #t6;
}
get lateGenericInstanceField() → self::Class::T%
return this.{self::Class::_#Class#lateGenericInstanceField#isSet} ?{self::Class::T%} let final self::Class::T? #t7 = this.{self::Class::_#Class#lateGenericInstanceField} in #t7{self::Class::T%} : throw new _in::LateInitializationErrorImpl::•("Field 'lateGenericInstanceField' has not been initialized.");
set lateGenericInstanceField(generic-covariant-impl self::Class::T% #t8) → void {
@ -46,28 +55,39 @@ class Class<T extends core::Object? = dynamic> extends core::Object {
}
extension Extension<T extends core::Object? = dynamic> on self::Class<T%> {
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static set lateExtensionField1 = set self::Extension|lateExtensionField1;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static set lateExtensionField2 = set self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? _#lateTopLevelField = null;
static field core::bool _#lateTopLevelField#isSet = false;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? _#Extension|lateExtensionField2 = null;
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static get lateTopLevelField() → core::int
return let final core::int? #t9 = self::_#lateTopLevelField in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.") : #t9{core::int};
static set lateTopLevelField(core::int #t10) → void
return self::_#lateTopLevelField#isSet ?{core::int} let final core::int? #t9 = self::_#lateTopLevelField in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.");
static set lateTopLevelField(core::int #t10) → void {
self::_#lateTopLevelField#isSet = true;
self::_#lateTopLevelField = #t10;
}
static get Extension|lateExtensionField1() → core::int
return let final core::int? #t11 = self::_#Extension|lateExtensionField1 in #t11.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.") : #t11{core::int};
static set Extension|lateExtensionField1(core::int #t12) → void
return self::_#Extension|lateExtensionField1#isSet ?{core::int} let final core::int? #t11 = self::_#Extension|lateExtensionField1 in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.");
static set Extension|lateExtensionField1(core::int #t12) → void {
self::_#Extension|lateExtensionField1#isSet = true;
self::_#Extension|lateExtensionField1 = #t12;
}
static get Extension|lateExtensionField2() → core::int
return let final core::int? #t13 = self::_#Extension|lateExtensionField2 in #t13.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.") : #t13{core::int};
static set Extension|lateExtensionField2(core::int #t14) → void
return self::_#Extension|lateExtensionField2#isSet ?{core::int} let final core::int? #t13 = self::_#Extension|lateExtensionField2 in #t13{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.");
static set Extension|lateExtensionField2(core::int #t14) → void {
self::_#Extension|lateExtensionField2#isSet = true;
self::_#Extension|lateExtensionField2 = #t14;
}
static method Extension|staticMethod() → dynamic {
self::throws(() → core::int => self::Extension|lateExtensionField2, "Read value from uninitialized Class.lateExtensionField2");
self::Extension|lateExtensionField2 = 42;

View file

@ -23,10 +23,13 @@ class C extends self::B {
class Class<T extends core::Object? = dynamic> extends core::Object {
static field core::int? lateStaticField1Init = null;
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? lateStaticField2Init = null;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? lateInstanceFieldInit = null;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
generic-covariant-impl field self::Class::T? lateGenericFieldInit = null;
final field self::Class::T% field;
field self::Class::T? _#Class#lateGenericField = null;
@ -80,19 +83,24 @@ extension Extension<T extends core::Object? = dynamic> on self::Class<T%> {
static field lateExtensionField1Init = self::Extension|lateExtensionField1Init;
static method initLateExtensionField1 = self::Extension|initLateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static field lateExtensionField2Init = self::Extension|lateExtensionField2Init;
static method initLateExtensionField2 = self::Extension|initLateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? lateTopLevelField1Init;
static field core::int? _#lateTopLevelField1 = null;
static field core::bool _#lateTopLevelField1#isSet = false;
static field core::int? Extension|lateExtensionField1Init;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? Extension|lateExtensionField2Init;
static field core::int? _#Extension|lateExtensionField2 = null;
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static method initLateTopLevelField1(core::int value) → core::int {
return self::lateTopLevelField1Init = value;
}

View file

@ -23,10 +23,13 @@ class C extends self::B {
class Class<T extends core::Object? = dynamic> extends core::Object {
static field core::int? lateStaticField1Init = null;
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? lateStaticField2Init = null;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? lateInstanceFieldInit = null;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
generic-covariant-impl field self::Class::T? lateGenericFieldInit = null;
final field self::Class::T% field;
field self::Class::T? _#Class#lateGenericField = null;
@ -80,19 +83,24 @@ extension Extension<T extends core::Object? = dynamic> on self::Class<T%> {
static field lateExtensionField1Init = self::Extension|lateExtensionField1Init;
static method initLateExtensionField1 = self::Extension|initLateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static field lateExtensionField2Init = self::Extension|lateExtensionField2Init;
static method initLateExtensionField2 = self::Extension|initLateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? lateTopLevelField1Init;
static field core::int? _#lateTopLevelField1 = null;
static field core::bool _#lateTopLevelField1#isSet = false;
static field core::int? Extension|lateExtensionField1Init;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? Extension|lateExtensionField2Init;
static field core::int? _#Extension|lateExtensionField2 = null;
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static method initLateTopLevelField1(core::int value) → core::int {
return self::lateTopLevelField1Init = value;
}

View file

@ -5,25 +5,32 @@ import "dart:_internal" as _in;
class Class extends core::Object {
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
synthetic constructor •() → self::Class
: super core::Object::•()
;
static get lateStaticField1() → core::int
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.") : #t1{core::int};
return self::Class::_#lateStaticField1#isSet ?{core::int} let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.");
static set lateStaticField1(core::int #t2) → void
if(self::Class::_#lateStaticField1.==(null))
self::Class::_#lateStaticField1 = #t2;
else
if(self::Class::_#lateStaticField1#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has already been initialized.");
else {
self::Class::_#lateStaticField1#isSet = true;
self::Class::_#lateStaticField1 = #t2;
}
static get lateStaticField2() → core::int
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.") : #t3{core::int};
return self::Class::_#lateStaticField2#isSet ?{core::int} let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.");
static set lateStaticField2(core::int #t4) → void
if(self::Class::_#lateStaticField2.==(null))
self::Class::_#lateStaticField2 = #t4;
else
if(self::Class::_#lateStaticField2#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has already been initialized.");
else {
self::Class::_#lateStaticField2#isSet = true;
self::Class::_#lateStaticField2 = #t4;
}
static method staticMethod() → dynamic {
self::throws(() → core::int => self::Class::lateStaticField2, "Read value from uninitialized Class.lateStaticField2");
self::Class::lateStaticField2 = 42;
@ -31,12 +38,14 @@ class Class extends core::Object {
self::throws(() → core::int => self::Class::lateStaticField2 = 43, "Write value to initialized Class.lateStaticField2");
}
get lateInstanceField() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.") : #t5{core::int};
return this.{self::Class::_#Class#lateInstanceField#isSet} ?{core::int} let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.");
set lateInstanceField(core::int #t6) → void
if(this.{self::Class::_#Class#lateInstanceField}.==(null))
this.{self::Class::_#Class#lateInstanceField} = #t6;
else
if(this.{self::Class::_#Class#lateInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has already been initialized.");
else {
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
this.{self::Class::_#Class#lateInstanceField} = #t6;
}
method instanceMethod() → dynamic {
self::throws(() → core::int => this.{self::Class::lateInstanceField}, "Read value from uninitialized Class.lateInstanceField");
this.{self::Class::lateInstanceField} = 16;
@ -46,37 +55,48 @@ class Class extends core::Object {
}
extension Extension on self::Class {
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static set lateExtensionField1 = set self::Extension|lateExtensionField1;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static set lateExtensionField2 = set self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? _#lateTopLevelField = null;
static field core::bool _#lateTopLevelField#isSet = false;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? _#Extension|lateExtensionField2 = null;
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static get lateTopLevelField() → core::int
return let final core::int? #t7 = self::_#lateTopLevelField in #t7.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.") : #t7{core::int};
return self::_#lateTopLevelField#isSet ?{core::int} let final core::int? #t7 = self::_#lateTopLevelField in #t7{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.");
static set lateTopLevelField(core::int #t8) → void
if(self::_#lateTopLevelField.==(null))
self::_#lateTopLevelField = #t8;
else
if(self::_#lateTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has already been initialized.");
else {
self::_#lateTopLevelField#isSet = true;
self::_#lateTopLevelField = #t8;
}
static get Extension|lateExtensionField1() → core::int
return let final core::int? #t9 = self::_#Extension|lateExtensionField1 in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.") : #t9{core::int};
return self::_#Extension|lateExtensionField1#isSet ?{core::int} let final core::int? #t9 = self::_#Extension|lateExtensionField1 in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.");
static set Extension|lateExtensionField1(core::int #t10) → void
if(self::_#Extension|lateExtensionField1.==(null))
self::_#Extension|lateExtensionField1 = #t10;
else
if(self::_#Extension|lateExtensionField1#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has already been initialized.");
else {
self::_#Extension|lateExtensionField1#isSet = true;
self::_#Extension|lateExtensionField1 = #t10;
}
static get Extension|lateExtensionField2() → core::int
return let final core::int? #t11 = self::_#Extension|lateExtensionField2 in #t11.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.") : #t11{core::int};
return self::_#Extension|lateExtensionField2#isSet ?{core::int} let final core::int? #t11 = self::_#Extension|lateExtensionField2 in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.");
static set Extension|lateExtensionField2(core::int #t12) → void
if(self::_#Extension|lateExtensionField2.==(null))
self::_#Extension|lateExtensionField2 = #t12;
else
if(self::_#Extension|lateExtensionField2#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has already been initialized.");
else {
self::_#Extension|lateExtensionField2#isSet = true;
self::_#Extension|lateExtensionField2 = #t12;
}
static method Extension|staticMethod() → dynamic {
self::throws(() → core::int => self::Extension|lateExtensionField2, "Read value from uninitialized Class.lateExtensionField2");
self::Extension|lateExtensionField2 = 42;

View file

@ -5,25 +5,32 @@ import "dart:_internal" as _in;
class Class extends core::Object {
static field core::int? _#lateStaticField1 = null;
static field core::bool _#lateStaticField1#isSet = false;
static field core::int? _#lateStaticField2 = null;
static field core::bool _#lateStaticField2#isSet = false;
field core::int? _#Class#lateInstanceField = null;
field core::bool _#Class#lateInstanceField#isSet = false;
synthetic constructor •() → self::Class
: super core::Object::•()
;
static get lateStaticField1() → core::int
return let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.") : #t1{core::int};
return self::Class::_#lateStaticField1#isSet ?{core::int} let final core::int? #t1 = self::Class::_#lateStaticField1 in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has not been initialized.");
static set lateStaticField1(core::int #t2) → void
if(self::Class::_#lateStaticField1.==(null))
self::Class::_#lateStaticField1 = #t2;
else
if(self::Class::_#lateStaticField1#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField1' has already been initialized.");
else {
self::Class::_#lateStaticField1#isSet = true;
self::Class::_#lateStaticField1 = #t2;
}
static get lateStaticField2() → core::int
return let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.") : #t3{core::int};
return self::Class::_#lateStaticField2#isSet ?{core::int} let final core::int? #t3 = self::Class::_#lateStaticField2 in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has not been initialized.");
static set lateStaticField2(core::int #t4) → void
if(self::Class::_#lateStaticField2.==(null))
self::Class::_#lateStaticField2 = #t4;
else
if(self::Class::_#lateStaticField2#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateStaticField2' has already been initialized.");
else {
self::Class::_#lateStaticField2#isSet = true;
self::Class::_#lateStaticField2 = #t4;
}
static method staticMethod() → dynamic {
self::throws(() → core::int => self::Class::lateStaticField2, "Read value from uninitialized Class.lateStaticField2");
self::Class::lateStaticField2 = 42;
@ -31,12 +38,14 @@ class Class extends core::Object {
self::throws(() → core::int => self::Class::lateStaticField2 = 43, "Write value to initialized Class.lateStaticField2");
}
get lateInstanceField() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.") : #t5{core::int};
return this.{self::Class::_#Class#lateInstanceField#isSet} ?{core::int} let final core::int? #t5 = this.{self::Class::_#Class#lateInstanceField} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has not been initialized.");
set lateInstanceField(core::int #t6) → void
if(this.{self::Class::_#Class#lateInstanceField}.==(null))
this.{self::Class::_#Class#lateInstanceField} = #t6;
else
if(this.{self::Class::_#Class#lateInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'lateInstanceField' has already been initialized.");
else {
this.{self::Class::_#Class#lateInstanceField#isSet} = true;
this.{self::Class::_#Class#lateInstanceField} = #t6;
}
method instanceMethod() → dynamic {
self::throws(() → core::int => this.{self::Class::lateInstanceField}, "Read value from uninitialized Class.lateInstanceField");
this.{self::Class::lateInstanceField} = 16;
@ -46,37 +55,48 @@ class Class extends core::Object {
}
extension Extension on self::Class {
static field lateExtensionField1 = self::_#Extension|lateExtensionField1;
static field lateExtensionField1 = self::_#Extension|lateExtensionField1#isSet;
static get lateExtensionField1 = get self::Extension|lateExtensionField1;
static set lateExtensionField1 = set self::Extension|lateExtensionField1;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2;
static field lateExtensionField2 = self::_#Extension|lateExtensionField2#isSet;
static get lateExtensionField2 = get self::Extension|lateExtensionField2;
static set lateExtensionField2 = set self::Extension|lateExtensionField2;
static method staticMethod = self::Extension|staticMethod;
}
static field core::int? _#lateTopLevelField = null;
static field core::bool _#lateTopLevelField#isSet = false;
static field core::int? _#Extension|lateExtensionField1 = null;
static field core::bool _#Extension|lateExtensionField1#isSet = false;
static field core::int? _#Extension|lateExtensionField2 = null;
static field core::bool _#Extension|lateExtensionField2#isSet = false;
static get lateTopLevelField() → core::int
return let final core::int? #t7 = self::_#lateTopLevelField in #t7.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.") : #t7{core::int};
return self::_#lateTopLevelField#isSet ?{core::int} let final core::int? #t7 = self::_#lateTopLevelField in #t7{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has not been initialized.");
static set lateTopLevelField(core::int #t8) → void
if(self::_#lateTopLevelField.==(null))
self::_#lateTopLevelField = #t8;
else
if(self::_#lateTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateTopLevelField' has already been initialized.");
else {
self::_#lateTopLevelField#isSet = true;
self::_#lateTopLevelField = #t8;
}
static get Extension|lateExtensionField1() → core::int
return let final core::int? #t9 = self::_#Extension|lateExtensionField1 in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.") : #t9{core::int};
return self::_#Extension|lateExtensionField1#isSet ?{core::int} let final core::int? #t9 = self::_#Extension|lateExtensionField1 in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has not been initialized.");
static set Extension|lateExtensionField1(core::int #t10) → void
if(self::_#Extension|lateExtensionField1.==(null))
self::_#Extension|lateExtensionField1 = #t10;
else
if(self::_#Extension|lateExtensionField1#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField1' has already been initialized.");
else {
self::_#Extension|lateExtensionField1#isSet = true;
self::_#Extension|lateExtensionField1 = #t10;
}
static get Extension|lateExtensionField2() → core::int
return let final core::int? #t11 = self::_#Extension|lateExtensionField2 in #t11.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.") : #t11{core::int};
return self::_#Extension|lateExtensionField2#isSet ?{core::int} let final core::int? #t11 = self::_#Extension|lateExtensionField2 in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has not been initialized.");
static set Extension|lateExtensionField2(core::int #t12) → void
if(self::_#Extension|lateExtensionField2.==(null))
self::_#Extension|lateExtensionField2 = #t12;
else
if(self::_#Extension|lateExtensionField2#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'lateExtensionField2' has already been initialized.");
else {
self::_#Extension|lateExtensionField2#isSet = true;
self::_#Extension|lateExtensionField2 = #t12;
}
static method Extension|staticMethod() → dynamic {
self::throws(() → core::int => self::Extension|lateExtensionField2, "Read value from uninitialized Class.lateExtensionField2");
self::Extension|lateExtensionField2 = 42;

View file

@ -8,8 +8,14 @@ static method main() → dynamic {
return lateLocalInit = value;
}
final core::int? lateLocal;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} lateLocal = initLateLocal.call(123) : #t1{core::int};
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int {
if(!#lateLocal#isSet) {
lateLocal = initLateLocal.call(123);
#lateLocal#isSet = true;
}
return lateLocal{core::int};
}
self::expect(null, lateLocalInit);
self::expect(123, #lateLocal#get.call());
self::expect(123, lateLocalInit);

View file

@ -8,8 +8,14 @@ static method main() → dynamic {
return lateLocalInit = value;
}
final core::int? lateLocal;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} lateLocal = initLateLocal.call(123) : #t1{core::int};
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int {
if(!#lateLocal#isSet) {
lateLocal = initLateLocal.call(123);
#lateLocal#isSet = true;
}
return lateLocal{core::int};
}
self::expect(null, lateLocalInit);
self::expect(123, #lateLocal#get.call());
self::expect(123, lateLocalInit);

View file

@ -6,13 +6,16 @@ import "dart:_internal" as _in;
static method main() → dynamic {
core::bool b = false;
final core::int? lateLocal;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.") : #t1{core::int};
function #lateLocal#set(core::int #t2) → dynamic
if(lateLocal.==(null))
return lateLocal = #t2;
else
return #lateLocal#isSet ?{core::int} lateLocal{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.");
function #lateLocal#set(core::int #t1) → dynamic
if(#lateLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has already been initialized.");
else {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
if(b) {
#lateLocal#set.call(123);
}
@ -27,12 +30,12 @@ static method main() → dynamic {
core::bool #lateGenericLocal#isSet = false;
function #lateGenericLocal#get() → T%
return #lateGenericLocal#isSet ?{T%} lateGenericLocal{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'lateGenericLocal' has not been initialized.");
function #lateGenericLocal#set(T% #t3) → dynamic
function #lateGenericLocal#set(T% #t2) → dynamic
if(#lateGenericLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'lateGenericLocal' has already been initialized.");
else {
#lateGenericLocal#isSet = true;
return lateGenericLocal = #t3;
return lateGenericLocal = #t2;
}
if(b) {
#lateGenericLocal#set.call(value);

View file

@ -6,13 +6,16 @@ import "dart:_internal" as _in;
static method main() → dynamic {
core::bool b = false;
final core::int? lateLocal;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.") : #t1{core::int};
function #lateLocal#set(core::int #t2) → dynamic
if(lateLocal.==(null))
return lateLocal = #t2;
else
return #lateLocal#isSet ?{core::int} lateLocal{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.");
function #lateLocal#set(core::int #t1) → dynamic
if(#lateLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has already been initialized.");
else {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
if(b) {
#lateLocal#set.call(123);
}
@ -27,12 +30,12 @@ static method main() → dynamic {
core::bool #lateGenericLocal#isSet = false;
function #lateGenericLocal#get() → T%
return #lateGenericLocal#isSet ?{T%} lateGenericLocal{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'lateGenericLocal' has not been initialized.");
function #lateGenericLocal#set(T% #t3) → dynamic
function #lateGenericLocal#set(T% #t2) → dynamic
if(#lateGenericLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'lateGenericLocal' has already been initialized.");
else {
#lateGenericLocal#isSet = true;
return lateGenericLocal = #t3;
return lateGenericLocal = #t2;
}
if(b) {
#lateGenericLocal#set.call(value);

View file

@ -149,10 +149,17 @@ static set field3(FutureOr<dynamic>#t14) → void {
self::_#field3#isSet = true;
self::_#field3 = #t14;
}
static get field4() → FutureOr<core::int>
return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{FutureOr<core::int>} self::_#field4 = self::method4() : #t15{FutureOr<core::int>};
static set field4(FutureOr<core::int>#t16) → void
static get field4() → FutureOr<core::int> {
if(!self::_#field4#isSet) {
self::_#field4 = self::method4();
self::_#field4#isSet = true;
}
return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15{FutureOr<core::int>};
}
static set field4(FutureOr<core::int>#t16) → void {
self::_#field4#isSet = true;
self::_#field4 = #t16;
}
static get field5() → FutureOr<core::int?> {
if(!self::_#field5#isSet) {
self::_#field5 = self::method5();

View file

@ -149,10 +149,17 @@ static set field3(FutureOr<dynamic>#t14) → void {
self::_#field3#isSet = true;
self::_#field3 = #t14;
}
static get field4() → FutureOr<core::int>
return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15.==(null) ?{FutureOr<core::int>} self::_#field4 = self::method4() : #t15{FutureOr<core::int>};
static set field4(FutureOr<core::int>#t16) → void
static get field4() → FutureOr<core::int> {
if(!self::_#field4#isSet) {
self::_#field4 = self::method4();
self::_#field4#isSet = true;
}
return let final FutureOr<core::int>? #t15 = self::_#field4 in #t15{FutureOr<core::int>};
}
static set field4(FutureOr<core::int>#t16) → void {
self::_#field4#isSet = true;
self::_#field4 = #t16;
}
static get field5() → FutureOr<core::int?> {
if(!self::_#field5#isSet) {
self::_#field5 = self::method5();

View file

@ -4,10 +4,18 @@ import "dart:core" as core;
static method main() → dynamic {
core::int? lateLocal;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} lateLocal = 123 : #t1{core::int};
function #lateLocal#set(core::int #t2) → dynamic
return lateLocal = #t2;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int {
if(!#lateLocal#isSet) {
lateLocal = 123;
#lateLocal#isSet = true;
}
return lateLocal{core::int};
}
function #lateLocal#set(core::int #t1) → dynamic {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
self::expect(123, #lateLocal#get.call());
self::expect(124, #lateLocal#set.call(124));
self::expect(124, #lateLocal#get.call());
@ -21,9 +29,9 @@ static method main() → dynamic {
}
return lateGenericLocal{T%};
}
function #lateGenericLocal#set(T% #t3) → dynamic {
function #lateGenericLocal#set(T% #t2) → dynamic {
#lateGenericLocal#isSet = true;
return lateGenericLocal = #t3;
return lateGenericLocal = #t2;
}
self::expect(value1, #lateGenericLocal#get.call());
self::expect(value2, #lateGenericLocal#set.call(value2));

View file

@ -4,10 +4,18 @@ import "dart:core" as core;
static method main() → dynamic {
core::int? lateLocal;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} lateLocal = 123 : #t1{core::int};
function #lateLocal#set(core::int #t2) → dynamic
return lateLocal = #t2;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int {
if(!#lateLocal#isSet) {
lateLocal = 123;
#lateLocal#isSet = true;
}
return lateLocal{core::int};
}
function #lateLocal#set(core::int #t1) → dynamic {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
self::expect(123, #lateLocal#get.call());
self::expect(124, #lateLocal#set.call(124));
self::expect(124, #lateLocal#get.call());
@ -21,9 +29,9 @@ static method main() → dynamic {
}
return lateGenericLocal{T%};
}
function #lateGenericLocal#set(T% #t3) → dynamic {
function #lateGenericLocal#set(T% #t2) → dynamic {
#lateGenericLocal#isSet = true;
return lateGenericLocal = #t3;
return lateGenericLocal = #t2;
}
self::expect(value1, #lateGenericLocal#get.call());
self::expect(value2, #lateGenericLocal#set.call(value2));

View file

@ -5,10 +5,13 @@ import "dart:_internal" as _in;
static method main() → dynamic {
core::int? lateLocal;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.") : #t1{core::int};
function #lateLocal#set(core::int #t2) → dynamic
return lateLocal = #t2;
return #lateLocal#isSet ?{core::int} lateLocal{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.");
function #lateLocal#set(core::int #t1) → dynamic {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
self::throws(() → core::int => #lateLocal#get.call(), "Read value from uninitialized lateLocal");
self::expect(123, #lateLocal#set.call(123));
self::expect(123, #lateLocal#get.call());
@ -17,9 +20,9 @@ static method main() → dynamic {
core::bool #lateGenericLocal#isSet = false;
function #lateGenericLocal#get() → T%
return #lateGenericLocal#isSet ?{T%} lateGenericLocal{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'lateGenericLocal' has not been initialized.");
function #lateGenericLocal#set(T% #t3) → dynamic {
function #lateGenericLocal#set(T% #t2) → dynamic {
#lateGenericLocal#isSet = true;
return lateGenericLocal = #t3;
return lateGenericLocal = #t2;
}
self::throws(() → T% => #lateGenericLocal#get.call(), "Read value from uninitialized lateGenericLocal");
self::expect(value, #lateGenericLocal#set.call(value));

View file

@ -5,10 +5,13 @@ import "dart:_internal" as _in;
static method main() → dynamic {
core::int? lateLocal;
core::bool #lateLocal#isSet = false;
function #lateLocal#get() → core::int
return let final core::int? #t1 = lateLocal in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.") : #t1{core::int};
function #lateLocal#set(core::int #t2) → dynamic
return lateLocal = #t2;
return #lateLocal#isSet ?{core::int} lateLocal{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'lateLocal' has not been initialized.");
function #lateLocal#set(core::int #t1) → dynamic {
#lateLocal#isSet = true;
return lateLocal = #t1;
}
self::throws(() → core::int => #lateLocal#get.call(), "Read value from uninitialized lateLocal");
self::expect(123, #lateLocal#set.call(123));
self::expect(123, #lateLocal#get.call());
@ -17,9 +20,9 @@ static method main() → dynamic {
core::bool #lateGenericLocal#isSet = false;
function #lateGenericLocal#get() → T%
return #lateGenericLocal#isSet ?{T%} lateGenericLocal{T%} : throw new _in::LateInitializationErrorImpl::•("Local 'lateGenericLocal' has not been initialized.");
function #lateGenericLocal#set(T% #t3) → dynamic {
function #lateGenericLocal#set(T% #t2) → dynamic {
#lateGenericLocal#isSet = true;
return lateGenericLocal = #t3;
return lateGenericLocal = #t2;
}
self::throws(() → T% => #lateGenericLocal#get.call(), "Read value from uninitialized lateGenericLocal");
self::expect(value, #lateGenericLocal#set.call(value));

View file

@ -70,17 +70,26 @@ import "dart:async" as asy;
class A extends core::Object {
field core::int a = 42;
field core::int? _#A#b = null;
field core::bool _#A#b#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
get b() → core::int
return let final core::int? #t1 = this.{self::A::_#A#b} in #t1.==(null) ?{core::int} this.{self::A::_#A#b} = this.{self::A::a}.{core::num::*}(2).{core::int::>>}(1) : #t1{core::int};
set b(core::int #t2) → void
get b() → core::int {
if(!this.{self::A::_#A#b#isSet}) {
this.{self::A::_#A#b} = this.{self::A::a}.{core::num::*}(2).{core::int::>>}(1);
this.{self::A::_#A#b#isSet} = true;
}
return let final core::int? #t1 = this.{self::A::_#A#b} in #t1{core::int};
}
set b(core::int #t2) → void {
this.{self::A::_#A#b#isSet} = true;
this.{self::A::_#A#b} = #t2;
}
method foo(core::int x) → dynamic {}
}
class B extends core::Object /*hasConstConstructor*/ {
field core::int? _#B#x = null;
field core::bool _#B#x#isSet = false;
const constructor •() → self::B
: super core::Object::•()
;
@ -89,16 +98,19 @@ class B extends core::Object /*hasConstConstructor*/ {
}
class C extends core::Object {
field core::int? _#C#x = null;
field core::bool _#C#x#isSet = false;
synthetic constructor •() → self::C
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t5 = this.{self::C::_#C#x} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t5{core::int};
return this.{self::C::_#C#x#isSet} ?{core::int} let final core::int? #t5 = this.{self::C::_#C#x} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t6) → void
if(this.{self::C::_#C#x}.==(null))
this.{self::C::_#C#x} = #t6;
else
if(this.{self::C::_#C#x#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'x' has already been initialized.");
else {
this.{self::C::_#C#x#isSet} = true;
this.{self::C::_#C#x} = #t6;
}
method initVars() → dynamic {
this.{self::C::x} = 42;
}
@ -138,24 +150,48 @@ static method hest() → dynamic async {
}
static method fisk() → dynamic async {
core::String? s1;
function #s1#get() → core::String
return let final core::String? #t8 = s1 in #t8.==(null) ?{core::String} s1 = invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:40:20: Error: `await` expressions are not supported in late local initializers.
core::bool #s1#isSet = false;
function #s1#get() → core::String {
if(!#s1#isSet) {
s1 = invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:40:20: Error: `await` expressions are not supported in late local initializers.
late String s1 = await hest(); // Error.
^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} core::String : #t8{core::String};
function #s1#set(core::String #t9) → dynamic
return s1 = #t9;
^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} core::String;
#s1#isSet = true;
}
return s1{core::String};
}
function #s1#set(core::String #t8) → dynamic {
#s1#isSet = true;
return s1 = #t8;
}
core::String? s2;
function #s2#get() → core::String
return let final core::String? #t10 = s2 in #t10.==(null) ?{core::String} s2 = "${#C1}${invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:41:30: Error: `await` expressions are not supported in late local initializers.
core::bool #s2#isSet = false;
function #s2#get() → core::String {
if(!#s2#isSet) {
s2 = "${#C1}${invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:41:30: Error: `await` expressions are not supported in late local initializers.
late String s2 = '\${fisk}\${await hest()}\${fisk}'; // Error.
^^^^^"}${#C1}" : #t10{core::String};
function #s2#set(core::String #t11) → dynamic
return s2 = #t11;
^^^^^"}${#C1}";
#s2#isSet = true;
}
return s2{core::String};
}
function #s2#set(core::String #t9) → dynamic {
#s2#isSet = true;
return s2 = #t9;
}
core::Function? f;
function #f#get() → core::Function
return let final core::Function? #t12 = f in #t12.==(null) ?{core::Function} f = () → asy::Future<dynamic> async => await self::hest() : #t12{core::Function};
function #f#set(core::Function #t13) → dynamic
return f = #t13;
core::bool #f#isSet = false;
function #f#get() → core::Function {
if(!#f#isSet) {
f = () → asy::Future<dynamic> async => await self::hest();
#f#isSet = true;
}
return f{core::Function};
}
function #f#set(core::Function #t10) → dynamic {
#f#isSet = true;
return f = #t10;
}
}
static method main() → dynamic {}

View file

@ -70,17 +70,26 @@ import "dart:async" as asy;
class A extends core::Object {
field core::int a = 42;
field core::int? _#A#b = null;
field core::bool _#A#b#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
get b() → core::int
return let final core::int? #t1 = this.{self::A::_#A#b} in #t1.==(null) ?{core::int} this.{self::A::_#A#b} = this.{self::A::a}.{core::num::*}(2).{core::int::>>}(1) : #t1{core::int};
set b(core::int #t2) → void
get b() → core::int {
if(!this.{self::A::_#A#b#isSet}) {
this.{self::A::_#A#b} = this.{self::A::a}.{core::num::*}(2).{core::int::>>}(1);
this.{self::A::_#A#b#isSet} = true;
}
return let final core::int? #t1 = this.{self::A::_#A#b} in #t1{core::int};
}
set b(core::int #t2) → void {
this.{self::A::_#A#b#isSet} = true;
this.{self::A::_#A#b} = #t2;
}
method foo(core::int x) → dynamic {}
}
class B extends core::Object /*hasConstConstructor*/ {
field core::int? _#B#x = null;
field core::bool _#B#x#isSet = false;
const constructor •() → self::B
: super core::Object::•()
;
@ -89,16 +98,19 @@ class B extends core::Object /*hasConstConstructor*/ {
}
class C extends core::Object {
field core::int? _#C#x = null;
field core::bool _#C#x#isSet = false;
synthetic constructor •() → self::C
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t5 = this.{self::C::_#C#x} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t5{core::int};
return this.{self::C::_#C#x#isSet} ?{core::int} let final core::int? #t5 = this.{self::C::_#C#x} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t6) → void
if(this.{self::C::_#C#x}.==(null))
this.{self::C::_#C#x} = #t6;
else
if(this.{self::C::_#C#x#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'x' has already been initialized.");
else {
this.{self::C::_#C#x#isSet} = true;
this.{self::C::_#C#x} = #t6;
}
method initVars() → dynamic {
this.{self::C::x} = 42;
}
@ -204,52 +216,76 @@ static method fisk() → dynamic /* originally async */ {
#L3:
{
core::String? s1;
function #s1#get() → core::String
return let final core::String? #t11 = s1 in #t11.==(null) ?{core::String} s1 = invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:40:20: Error: `await` expressions are not supported in late local initializers.
core::bool #s1#isSet = false;
function #s1#get() → core::String {
if(!#s1#isSet) {
s1 = invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:40:20: Error: `await` expressions are not supported in late local initializers.
late String s1 = await hest(); // Error.
^^^^^" : #t11{core::String};
function #s1#set(core::String #t12) → dynamic
return s1 = #t12;
^^^^^";
#s1#isSet = true;
}
return s1{core::String};
}
function #s1#set(core::String #t11) → dynamic {
#s1#isSet = true;
return s1 = #t11;
}
core::String? s2;
function #s2#get() → core::String
return let final core::String? #t13 = s2 in #t13.==(null) ?{core::String} s2 = "${#C1}${invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:41:30: Error: `await` expressions are not supported in late local initializers.
core::bool #s2#isSet = false;
function #s2#get() → core::String {
if(!#s2#isSet) {
s2 = "${#C1}${invalid-expression "pkg/front_end/testcases/late_lowering/later.dart:41:30: Error: `await` expressions are not supported in late local initializers.
late String s2 = '\${fisk}\${await hest()}\${fisk}'; // Error.
^^^^^"}${#C1}" : #t13{core::String};
function #s2#set(core::String #t14) → dynamic
return s2 = #t14;
^^^^^"}${#C1}";
#s2#isSet = true;
}
return s2{core::String};
}
function #s2#set(core::String #t12) → dynamic {
#s2#isSet = true;
return s2 = #t12;
}
core::Function? f;
function #f#get() → core::Function
return let final core::Function? #t15 = f in #t15.==(null) ?{core::Function} f = () → asy::Future<dynamic> /* originally async */ {
final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
FutureOr<dynamic>? :return_value;
dynamic :async_stack_trace;
(dynamic) → dynamic :async_op_then;
(core::Object, core::StackTrace) → dynamic :async_op_error;
core::int :await_jump_var = 0;
dynamic :await_ctx_var;
dynamic :saved_try_context_var0;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
try {
#L4:
{
[yield] let dynamic #t16 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error, :async_op) in null;
:return_value = :result;
break #L4;
core::bool #f#isSet = false;
function #f#get() → core::Function {
if(!#f#isSet) {
f = () → asy::Future<dynamic> /* originally async */ {
final asy::_AsyncAwaitCompleter<dynamic> :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>();
FutureOr<dynamic>? :return_value;
dynamic :async_stack_trace;
(dynamic) → dynamic :async_op_then;
(core::Object, core::StackTrace) → dynamic :async_op_error;
core::int :await_jump_var = 0;
dynamic :await_ctx_var;
dynamic :saved_try_context_var0;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
try {
#L4:
{
[yield] let dynamic #t13 = asy::_awaitHelper(self::hest(), :async_op_then, :async_op_error, :async_op) in null;
:return_value = :result;
break #L4;
}
asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic exception, core::StackTrace stack_trace) {
:async_completer.{asy::Completer::completeError}(exception, stack_trace);
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
:async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
return :async_completer.{asy::Completer::future};
} : #t15{core::Function};
function #f#set(core::Function #t17) → dynamic
return f = #t17;
on dynamic catch(dynamic exception, core::StackTrace stack_trace) {
:async_completer.{asy::Completer::completeError}(exception, stack_trace);
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
:async_completer.{asy::_AsyncAwaitCompleter::start}(:async_op);
return :async_completer.{asy::Completer::future};
};
#f#isSet = true;
}
return f{core::Function};
}
function #f#set(core::Function #t14) → dynamic {
#f#isSet = true;
return f = #t14;
}
}
asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;

View file

@ -0,0 +1,37 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart=2.8
import 'non_nullable_from_opt_out_lib.dart';
main() {
topLevelField = null;
finalTopLevelField = null;
var c = new Class<int>();
c.instanceField = null;
c.finalInstanceField = null;
c.instanceTypeVariable = null;
c.finalInstanceTypeVariable = null;
Class.staticField = null;
Class.staticFinalField = null;
expect(null, topLevelField);
expect(null, finalTopLevelField);
expect(null, c.instanceField);
expect(null, c.finalInstanceField);
expect(null, c.instanceTypeVariable);
expect(null, c.finalInstanceTypeVariable);
expect(null, Class.staticField);
expect(null, Class.staticFinalField);
throws(() => finalTopLevelField = null);
throws(() => c.finalInstanceField = null);
throws(() => c.finalInstanceTypeVariable = null);
throws(() => Class.staticFinalField = null);
method(true, null, null);
}

View file

@ -0,0 +1,56 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// // @dart=2.8
// ^^^^^^^^^^^^
//
import self as self;
import "org-dartlang-testcase:///non_nullable_from_opt_out_lib.dart";
static method main() → dynamic
;
library /*isNonNullableByDefault*/;
import self as self2;
import "dart:core" as core;
class Class<T extends core::Object = core::Object> extends core::Object {
field core::int? _#Class#instanceField;
field dynamic _#Class#finalInstanceField;
field core::bool _#Class#finalInstanceField#isSet;
generic-covariant-impl field self2::Class::T? _#Class#instanceTypeVariable;
field self2::Class::T? _#Class#finalInstanceTypeVariable;
static field core::int? _#staticField;
static field dynamic _#staticFinalField;
static field core::bool _#staticFinalField#isSet;
synthetic constructor •() → self2::Class<self2::Class::T>
;
get instanceField() → core::int;
set instanceField(core::int #t1) → void;
get finalInstanceField() → dynamic;
set finalInstanceField(dynamic #t2) → void;
get instanceTypeVariable() → self2::Class::T;
set instanceTypeVariable(generic-covariant-impl self2::Class::T #t3) → void;
get finalInstanceTypeVariable() → self2::Class::T;
set finalInstanceTypeVariable(self2::Class::T #t4) → void;
static get staticField() → core::int;
static set staticField(core::int #t5) → void;
static get staticFinalField() → dynamic;
static set staticFinalField(dynamic #t6) → void;
}
static field core::int? _#topLevelField;
static field dynamic _#finalTopLevelField;
static field core::bool _#finalTopLevelField#isSet;
static get topLevelField() → core::int;
static set topLevelField(core::int #t7) → void;
static get finalTopLevelField() → dynamic;
static set finalTopLevelField(dynamic #t8) → void;
static method method<T extends core::Object = core::Object>(core::bool b, core::int i, self2::method::T t) → dynamic
;
static method expect(dynamic expected, dynamic actual) → dynamic
;
static method throws(() → void f) → dynamic
;

View file

@ -0,0 +1,217 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// // @dart=2.8
// ^^^^^^^^^^^^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:10:19: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// topLevelField = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:14:21: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// c.instanceField = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:16:28: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// c.instanceTypeVariable = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:17:33: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// c.finalInstanceTypeVariable = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:19:23: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// Class.staticField = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:33:46: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// throws(() => c.finalInstanceTypeVariable = null);
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:36:16: Error: The argument type 'Null' can't be assigned to the parameter type 'int'.
// method(true, null, null);
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:36:3: Error: Inferred type argument 'Null' doesn't conform to the bound 'Object' of the type variable 'T' on 'method'.
// - 'Object' is from 'dart:core'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// method(true, null, null);
// ^
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out_lib.dart:18:8: Context: This is the type variable whose bound isn't conformed to.
// method<T extends Object>(bool b, int i, T t) {
// ^
//
import self as self;
import "non_nullable_from_opt_out_lib.dart" as non;
import "dart:core" as core;
import "org-dartlang-testcase:///non_nullable_from_opt_out_lib.dart";
static method main() → dynamic {
non::topLevelField = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:10:19: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
topLevelField = null;
^" in null as{TypeError,ForNonNullableByDefault} core::int;
non::finalTopLevelField = null;
non::Class<core::int> c = new non::Class::•<core::int>();
c.{non::Class::instanceField} = let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:14:21: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
c.instanceField = null;
^" in null as{TypeError,ForNonNullableByDefault} core::int;
c.{non::Class::finalInstanceField} = null;
c.{non::Class::instanceTypeVariable} = let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:16:28: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
c.instanceTypeVariable = null;
^" in null as{TypeError,ForNonNullableByDefault} core::int;
c.{non::Class::finalInstanceTypeVariable} = let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:17:33: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
c.finalInstanceTypeVariable = null;
^" in null as{TypeError,ForNonNullableByDefault} core::int;
non::Class::staticField = let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:19:23: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
Class.staticField = null;
^" in null as{TypeError,ForNonNullableByDefault} core::int;
non::Class::staticFinalField = null;
non::expect(null, non::topLevelField);
non::expect(null, non::finalTopLevelField);
non::expect(null, c.{non::Class::instanceField});
non::expect(null, c.{non::Class::finalInstanceField});
non::expect(null, c.{non::Class::instanceTypeVariable});
non::expect(null, c.{non::Class::finalInstanceTypeVariable});
non::expect(null, non::Class::staticField);
non::expect(null, non::Class::staticFinalField);
non::throws(() → core::Null? => non::finalTopLevelField = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceField} = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceTypeVariable} = let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:33:46: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
throws(() => c.finalInstanceTypeVariable = null);
^" in null as{TypeError,ForNonNullableByDefault} core::int);
non::throws(() → core::Null? => non::Class::staticFinalField = null);
non::method<core::Null?>(true, let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:36:16: Error: The argument type 'Null' can't be assigned to the parameter type 'int'.
method(true, null, null);
^" in null as{TypeError,ForNonNullableByDefault} core::int, null);
}
library /*isNonNullableByDefault*/;
import self as non;
import "dart:core" as core;
import "dart:_internal" as _in;
class Class<T extends core::Object = core::Object> extends core::Object {
field core::int? _#Class#instanceField = null;
field dynamic _#Class#finalInstanceField = null;
field core::bool _#Class#finalInstanceField#isSet = false;
generic-covariant-impl field non::Class::T? _#Class#instanceTypeVariable = null;
field non::Class::T? _#Class#finalInstanceTypeVariable = null;
static field core::int? _#staticField = null;
static field dynamic _#staticFinalField = null;
static field core::bool _#staticFinalField#isSet = false;
synthetic constructor •() → non::Class<non::Class::T>
: super core::Object::•()
;
get instanceField() → core::int
return let final core::int? #t8 = this.{non::Class::_#Class#instanceField} in #t8.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.") : #t8{core::int};
set instanceField(core::int #t9) → void
this.{non::Class::_#Class#instanceField} = #t9;
get finalInstanceField() → dynamic
return this.{non::Class::_#Class#finalInstanceField#isSet} ?{dynamic} this.{non::Class::_#Class#finalInstanceField} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
set finalInstanceField(dynamic #t10) → void
if(this.{non::Class::_#Class#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{non::Class::_#Class#finalInstanceField#isSet} = true;
this.{non::Class::_#Class#finalInstanceField} = #t10;
}
get instanceTypeVariable() → non::Class::T
return let final non::Class::T? #t11 = this.{non::Class::_#Class#instanceTypeVariable} in #t11.==(null) ?{non::Class::T} throw new _in::LateInitializationErrorImpl::•("Field 'instanceTypeVariable' has not been initialized.") : #t11{non::Class::T};
set instanceTypeVariable(generic-covariant-impl non::Class::T #t12) → void
this.{non::Class::_#Class#instanceTypeVariable} = #t12;
get finalInstanceTypeVariable() → non::Class::T
return let final non::Class::T? #t13 = this.{non::Class::_#Class#finalInstanceTypeVariable} in #t13.==(null) ?{non::Class::T} throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has not been initialized.") : #t13{non::Class::T};
set finalInstanceTypeVariable(non::Class::T #t14) → void
if(this.{non::Class::_#Class#finalInstanceTypeVariable}.==(null))
this.{non::Class::_#Class#finalInstanceTypeVariable} = #t14;
else
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has already been initialized.");
static get staticField() → core::int
return let final core::int? #t15 = non::Class::_#staticField in #t15.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.") : #t15{core::int};
static set staticField(core::int #t16) → void
non::Class::_#staticField = #t16;
static get staticFinalField() → dynamic
return non::Class::_#staticFinalField#isSet ?{dynamic} non::Class::_#staticFinalField : throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has not been initialized.");
static set staticFinalField(dynamic #t17) → void
if(non::Class::_#staticFinalField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has already been initialized.");
else {
non::Class::_#staticFinalField#isSet = true;
non::Class::_#staticFinalField = #t17;
}
}
static field core::int? _#topLevelField = null;
static field dynamic _#finalTopLevelField = null;
static field core::bool _#finalTopLevelField#isSet = false;
static get topLevelField() → core::int
return let final core::int? #t18 = non::_#topLevelField in #t18.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.") : #t18{core::int};
static set topLevelField(core::int #t19) → void
non::_#topLevelField = #t19;
static get finalTopLevelField() → dynamic
return non::_#finalTopLevelField#isSet ?{dynamic} non::_#finalTopLevelField : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.");
static set finalTopLevelField(dynamic #t20) → void
if(non::_#finalTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has already been initialized.");
else {
non::_#finalTopLevelField#isSet = true;
non::_#finalTopLevelField = #t20;
}
static method method<T extends core::Object = core::Object>(core::bool b, core::int i, non::method::T t) → dynamic {
core::int? local;
function #local#get() → core::int
return let final core::int? #t21 = local in #t21.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.") : #t21{core::int};
function #local#set(core::int #t22) → dynamic
return local = #t22;
final dynamic finalLocal;
core::bool #finalLocal#isSet = false;
function #finalLocal#get() → dynamic
return #finalLocal#isSet ?{dynamic} finalLocal : throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has not been initialized.");
function #finalLocal#set(dynamic #t23) → dynamic
if(#finalLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has already been initialized.");
else {
#finalLocal#isSet = true;
return finalLocal = #t23;
}
non::method::T? localTypeVariable;
function #localTypeVariable#get() → non::method::T
return let final non::method::T? #t24 = localTypeVariable in #t24.==(null) ?{non::method::T} throw new _in::LateInitializationErrorImpl::•("Local 'localTypeVariable' has not been initialized.") : #t24{non::method::T};
function #localTypeVariable#set(non::method::T #t25) → dynamic
return localTypeVariable = #t25;
final non::method::T? finalLocalTypeVariable;
function #finalLocalTypeVariable#get() → non::method::T
return let final non::method::T? #t26 = finalLocalTypeVariable in #t26.==(null) ?{non::method::T} throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has not been initialized.") : #t26{non::method::T};
function #finalLocalTypeVariable#set(non::method::T #t27) → dynamic
if(finalLocalTypeVariable.==(null))
return finalLocalTypeVariable = #t27;
else
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has already been initialized.");
if(b) {
#local#set.call(i);
#finalLocal#set.call(i);
#localTypeVariable#set.call(t);
#finalLocalTypeVariable#set.call(t);
non::expect(i, #local#get.call());
non::expect(i, #finalLocal#get.call());
non::expect(t, #localTypeVariable#get.call());
non::expect(t, #finalLocalTypeVariable#get.call());
}
non::throws(() → core::int => #finalLocal#set.call(i));
non::throws(() → non::method::T => #finalLocalTypeVariable#set.call(t));
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
static method throws(() → void f) → dynamic {
try {
f.call();
}
on core::Object catch(final core::Object _) {
return;
}
throw "Missing exception";
}

View file

@ -0,0 +1,217 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// // @dart=2.8
// ^^^^^^^^^^^^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:10:19: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// topLevelField = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:14:21: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// c.instanceField = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:16:28: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// c.instanceTypeVariable = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:17:33: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// c.finalInstanceTypeVariable = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:19:23: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// Class.staticField = null;
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:33:46: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
// throws(() => c.finalInstanceTypeVariable = null);
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:36:16: Error: The argument type 'Null' can't be assigned to the parameter type 'int'.
// method(true, null, null);
// ^
//
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:36:3: Error: Inferred type argument 'Null' doesn't conform to the bound 'Object' of the type variable 'T' on 'method'.
// - 'Object' is from 'dart:core'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// method(true, null, null);
// ^
// pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out_lib.dart:18:8: Context: This is the type variable whose bound isn't conformed to.
// method<T extends Object>(bool b, int i, T t) {
// ^
//
import self as self;
import "non_nullable_from_opt_out_lib.dart" as non;
import "dart:core" as core;
import "org-dartlang-testcase:///non_nullable_from_opt_out_lib.dart";
static method main() → dynamic {
non::topLevelField = let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:10:19: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
topLevelField = null;
^" in let core::Null? #t2 = null in #t2.==(null) ?{core::int} #t2 as{TypeError,ForNonNullableByDefault} core::int : #t2{core::int};
non::finalTopLevelField = null;
non::Class<core::int> c = new non::Class::•<core::int>();
c.{non::Class::instanceField} = let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:14:21: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
c.instanceField = null;
^" in let core::Null? #t4 = null in #t4.==(null) ?{core::int} #t4 as{TypeError,ForNonNullableByDefault} core::int : #t4{core::int};
c.{non::Class::finalInstanceField} = null;
c.{non::Class::instanceTypeVariable} = let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:16:28: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
c.instanceTypeVariable = null;
^" in let core::Null? #t6 = null in #t6.==(null) ?{core::int} #t6 as{TypeError,ForNonNullableByDefault} core::int : #t6{core::int};
c.{non::Class::finalInstanceTypeVariable} = let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:17:33: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
c.finalInstanceTypeVariable = null;
^" in let core::Null? #t8 = null in #t8.==(null) ?{core::int} #t8 as{TypeError,ForNonNullableByDefault} core::int : #t8{core::int};
non::Class::staticField = let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:19:23: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
Class.staticField = null;
^" in let core::Null? #t10 = null in #t10.==(null) ?{core::int} #t10 as{TypeError,ForNonNullableByDefault} core::int : #t10{core::int};
non::Class::staticFinalField = null;
non::expect(null, non::topLevelField);
non::expect(null, non::finalTopLevelField);
non::expect(null, c.{non::Class::instanceField});
non::expect(null, c.{non::Class::finalInstanceField});
non::expect(null, c.{non::Class::instanceTypeVariable});
non::expect(null, c.{non::Class::finalInstanceTypeVariable});
non::expect(null, non::Class::staticField);
non::expect(null, non::Class::staticFinalField);
non::throws(() → core::Null? => non::finalTopLevelField = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceField} = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceTypeVariable} = let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:33:46: Error: A value of type 'Null' can't be assigned to a variable of type 'int'.
throws(() => c.finalInstanceTypeVariable = null);
^" in let core::Null? #t12 = null in #t12.==(null) ?{core::int} #t12 as{TypeError,ForNonNullableByDefault} core::int : #t12{core::int});
non::throws(() → core::Null? => non::Class::staticFinalField = null);
non::method<core::Null?>(true, let final<BottomType> #t13 = invalid-expression "pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart:36:16: Error: The argument type 'Null' can't be assigned to the parameter type 'int'.
method(true, null, null);
^" in let core::Null? #t14 = null in #t14.==(null) ?{core::int} #t14 as{TypeError,ForNonNullableByDefault} core::int : #t14{core::int}, null);
}
library /*isNonNullableByDefault*/;
import self as non;
import "dart:core" as core;
import "dart:_internal" as _in;
class Class<T extends core::Object = core::Object> extends core::Object {
field core::int? _#Class#instanceField = null;
field dynamic _#Class#finalInstanceField = null;
field core::bool _#Class#finalInstanceField#isSet = false;
generic-covariant-impl field non::Class::T? _#Class#instanceTypeVariable = null;
field non::Class::T? _#Class#finalInstanceTypeVariable = null;
static field core::int? _#staticField = null;
static field dynamic _#staticFinalField = null;
static field core::bool _#staticFinalField#isSet = false;
synthetic constructor •() → non::Class<non::Class::T>
: super core::Object::•()
;
get instanceField() → core::int
return let final core::int? #t15 = this.{non::Class::_#Class#instanceField} in #t15.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.") : #t15{core::int};
set instanceField(core::int #t16) → void
this.{non::Class::_#Class#instanceField} = #t16;
get finalInstanceField() → dynamic
return this.{non::Class::_#Class#finalInstanceField#isSet} ?{dynamic} this.{non::Class::_#Class#finalInstanceField} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
set finalInstanceField(dynamic #t17) → void
if(this.{non::Class::_#Class#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{non::Class::_#Class#finalInstanceField#isSet} = true;
this.{non::Class::_#Class#finalInstanceField} = #t17;
}
get instanceTypeVariable() → non::Class::T
return let final non::Class::T? #t18 = this.{non::Class::_#Class#instanceTypeVariable} in #t18.==(null) ?{non::Class::T} throw new _in::LateInitializationErrorImpl::•("Field 'instanceTypeVariable' has not been initialized.") : #t18{non::Class::T};
set instanceTypeVariable(generic-covariant-impl non::Class::T #t19) → void
this.{non::Class::_#Class#instanceTypeVariable} = #t19;
get finalInstanceTypeVariable() → non::Class::T
return let final non::Class::T? #t20 = this.{non::Class::_#Class#finalInstanceTypeVariable} in #t20.==(null) ?{non::Class::T} throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has not been initialized.") : #t20{non::Class::T};
set finalInstanceTypeVariable(non::Class::T #t21) → void
if(this.{non::Class::_#Class#finalInstanceTypeVariable}.==(null))
this.{non::Class::_#Class#finalInstanceTypeVariable} = #t21;
else
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has already been initialized.");
static get staticField() → core::int
return let final core::int? #t22 = non::Class::_#staticField in #t22.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.") : #t22{core::int};
static set staticField(core::int #t23) → void
non::Class::_#staticField = #t23;
static get staticFinalField() → dynamic
return non::Class::_#staticFinalField#isSet ?{dynamic} non::Class::_#staticFinalField : throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has not been initialized.");
static set staticFinalField(dynamic #t24) → void
if(non::Class::_#staticFinalField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has already been initialized.");
else {
non::Class::_#staticFinalField#isSet = true;
non::Class::_#staticFinalField = #t24;
}
}
static field core::int? _#topLevelField = null;
static field dynamic _#finalTopLevelField = null;
static field core::bool _#finalTopLevelField#isSet = false;
static get topLevelField() → core::int
return let final core::int? #t25 = non::_#topLevelField in #t25.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.") : #t25{core::int};
static set topLevelField(core::int #t26) → void
non::_#topLevelField = #t26;
static get finalTopLevelField() → dynamic
return non::_#finalTopLevelField#isSet ?{dynamic} non::_#finalTopLevelField : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.");
static set finalTopLevelField(dynamic #t27) → void
if(non::_#finalTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has already been initialized.");
else {
non::_#finalTopLevelField#isSet = true;
non::_#finalTopLevelField = #t27;
}
static method method<T extends core::Object = core::Object>(core::bool b, core::int i, non::method::T t) → dynamic {
core::int? local;
function #local#get() → core::int
return let final core::int? #t28 = local in #t28.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.") : #t28{core::int};
function #local#set(core::int #t29) → dynamic
return local = #t29;
final dynamic finalLocal;
core::bool #finalLocal#isSet = false;
function #finalLocal#get() → dynamic
return #finalLocal#isSet ?{dynamic} finalLocal : throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has not been initialized.");
function #finalLocal#set(dynamic #t30) → dynamic
if(#finalLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has already been initialized.");
else {
#finalLocal#isSet = true;
return finalLocal = #t30;
}
non::method::T? localTypeVariable;
function #localTypeVariable#get() → non::method::T
return let final non::method::T? #t31 = localTypeVariable in #t31.==(null) ?{non::method::T} throw new _in::LateInitializationErrorImpl::•("Local 'localTypeVariable' has not been initialized.") : #t31{non::method::T};
function #localTypeVariable#set(non::method::T #t32) → dynamic
return localTypeVariable = #t32;
final non::method::T? finalLocalTypeVariable;
function #finalLocalTypeVariable#get() → non::method::T
return let final non::method::T? #t33 = finalLocalTypeVariable in #t33.==(null) ?{non::method::T} throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has not been initialized.") : #t33{non::method::T};
function #finalLocalTypeVariable#set(non::method::T #t34) → dynamic
if(finalLocalTypeVariable.==(null))
return finalLocalTypeVariable = #t34;
else
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has already been initialized.");
if(b) {
#local#set.call(i);
#finalLocal#set.call(i);
#localTypeVariable#set.call(t);
#finalLocalTypeVariable#set.call(t);
non::expect(i, #local#get.call());
non::expect(i, #finalLocal#get.call());
non::expect(t, #localTypeVariable#get.call());
non::expect(t, #finalLocalTypeVariable#get.call());
}
non::throws(() → core::int => #finalLocal#set.call(i));
non::throws(() → non::method::T => #finalLocalTypeVariable#set.call(t));
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
static method throws(() → void f) → dynamic {
try {
f.call();
}
on core::Object catch(final core::Object _) {
return;
}
throw "Missing exception";
}

View file

@ -0,0 +1,4 @@
// @dart = 2.8
import 'non_nullable_from_opt_out_lib.dart';
main() {}

View file

@ -0,0 +1,4 @@
// @dart = 2.8
import 'non_nullable_from_opt_out_lib.dart';
main() {}

View file

@ -0,0 +1,183 @@
library;
import self as self;
import "non_nullable_from_opt_out_lib.dart" as non;
import "dart:core" as core;
import "org-dartlang-testcase:///non_nullable_from_opt_out_lib.dart";
static method main() → dynamic {
non::topLevelField = null;
non::finalTopLevelField = null;
non::Class<core::int*>* c = new non::Class::•<core::int*>();
c.{non::Class::instanceField} = null;
c.{non::Class::finalInstanceField} = null;
c.{non::Class::instanceTypeVariable} = null;
c.{non::Class::finalInstanceTypeVariable} = null;
non::Class::staticField = null;
non::Class::staticFinalField = null;
non::expect(null, non::topLevelField);
non::expect(null, non::finalTopLevelField);
non::expect(null, c.{non::Class::instanceField});
non::expect(null, c.{non::Class::finalInstanceField});
non::expect(null, c.{non::Class::instanceTypeVariable});
non::expect(null, c.{non::Class::finalInstanceTypeVariable});
non::expect(null, non::Class::staticField);
non::expect(null, non::Class::staticFinalField);
non::throws(() → core::Null? => non::finalTopLevelField = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceField} = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceTypeVariable} = null);
non::throws(() → core::Null? => non::Class::staticFinalField = null);
non::method<core::Null?>(true, null, null);
}
library /*isNonNullableByDefault*/;
import self as non;
import "dart:core" as core;
import "dart:_internal" as _in;
class Class<T extends core::Object = core::Object> extends core::Object {
field core::int? _#Class#instanceField = null;
field core::bool _#Class#instanceField#isSet = false;
field dynamic _#Class#finalInstanceField = null;
field core::bool _#Class#finalInstanceField#isSet = false;
generic-covariant-impl field non::Class::T? _#Class#instanceTypeVariable = null;
field core::bool _#Class#instanceTypeVariable#isSet = false;
field non::Class::T? _#Class#finalInstanceTypeVariable = null;
field core::bool _#Class#finalInstanceTypeVariable#isSet = false;
static field core::int? _#staticField = null;
static field core::bool _#staticField#isSet = false;
static field dynamic _#staticFinalField = null;
static field core::bool _#staticFinalField#isSet = false;
synthetic constructor •() → non::Class<non::Class::T>
: super core::Object::•()
;
get instanceField() → core::int
return this.{non::Class::_#Class#instanceField#isSet} ?{core::int} let final core::int? #t1 = this.{non::Class::_#Class#instanceField} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.");
set instanceField(core::int #t2) → void {
this.{non::Class::_#Class#instanceField#isSet} = true;
this.{non::Class::_#Class#instanceField} = #t2;
}
get finalInstanceField() → dynamic
return this.{non::Class::_#Class#finalInstanceField#isSet} ?{dynamic} this.{non::Class::_#Class#finalInstanceField} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
set finalInstanceField(dynamic #t3) → void
if(this.{non::Class::_#Class#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{non::Class::_#Class#finalInstanceField#isSet} = true;
this.{non::Class::_#Class#finalInstanceField} = #t3;
}
get instanceTypeVariable() → non::Class::T
return this.{non::Class::_#Class#instanceTypeVariable#isSet} ?{non::Class::T} let final non::Class::T? #t4 = this.{non::Class::_#Class#instanceTypeVariable} in #t4{non::Class::T} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceTypeVariable' has not been initialized.");
set instanceTypeVariable(generic-covariant-impl non::Class::T #t5) → void {
this.{non::Class::_#Class#instanceTypeVariable#isSet} = true;
this.{non::Class::_#Class#instanceTypeVariable} = #t5;
}
get finalInstanceTypeVariable() → non::Class::T
return this.{non::Class::_#Class#finalInstanceTypeVariable#isSet} ?{non::Class::T} let final non::Class::T? #t6 = this.{non::Class::_#Class#finalInstanceTypeVariable} in #t6{non::Class::T} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has not been initialized.");
set finalInstanceTypeVariable(non::Class::T #t7) → void
if(this.{non::Class::_#Class#finalInstanceTypeVariable#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has already been initialized.");
else {
this.{non::Class::_#Class#finalInstanceTypeVariable#isSet} = true;
this.{non::Class::_#Class#finalInstanceTypeVariable} = #t7;
}
static get staticField() → core::int
return non::Class::_#staticField#isSet ?{core::int} let final core::int? #t8 = non::Class::_#staticField in #t8{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.");
static set staticField(core::int #t9) → void {
non::Class::_#staticField#isSet = true;
non::Class::_#staticField = #t9;
}
static get staticFinalField() → dynamic
return non::Class::_#staticFinalField#isSet ?{dynamic} non::Class::_#staticFinalField : throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has not been initialized.");
static set staticFinalField(dynamic #t10) → void
if(non::Class::_#staticFinalField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has already been initialized.");
else {
non::Class::_#staticFinalField#isSet = true;
non::Class::_#staticFinalField = #t10;
}
}
static field core::int? _#topLevelField = null;
static field core::bool _#topLevelField#isSet = false;
static field dynamic _#finalTopLevelField = null;
static field core::bool _#finalTopLevelField#isSet = false;
static get topLevelField() → core::int
return non::_#topLevelField#isSet ?{core::int} let final core::int? #t11 = non::_#topLevelField in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.");
static set topLevelField(core::int #t12) → void {
non::_#topLevelField#isSet = true;
non::_#topLevelField = #t12;
}
static get finalTopLevelField() → dynamic
return non::_#finalTopLevelField#isSet ?{dynamic} non::_#finalTopLevelField : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.");
static set finalTopLevelField(dynamic #t13) → void
if(non::_#finalTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has already been initialized.");
else {
non::_#finalTopLevelField#isSet = true;
non::_#finalTopLevelField = #t13;
}
static method method<T extends core::Object = core::Object>(core::bool b, core::int i, non::method::T t) → dynamic {
core::int? local;
core::bool #local#isSet = false;
function #local#get() → core::int
return #local#isSet ?{core::int} local{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.");
function #local#set(core::int #t14) → dynamic {
#local#isSet = true;
return local = #t14;
}
final dynamic finalLocal;
core::bool #finalLocal#isSet = false;
function #finalLocal#get() → dynamic
return #finalLocal#isSet ?{dynamic} finalLocal : throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has not been initialized.");
function #finalLocal#set(dynamic #t15) → dynamic
if(#finalLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has already been initialized.");
else {
#finalLocal#isSet = true;
return finalLocal = #t15;
}
non::method::T? localTypeVariable;
core::bool #localTypeVariable#isSet = false;
function #localTypeVariable#get() → non::method::T
return #localTypeVariable#isSet ?{non::method::T} localTypeVariable{non::method::T} : throw new _in::LateInitializationErrorImpl::•("Local 'localTypeVariable' has not been initialized.");
function #localTypeVariable#set(non::method::T #t16) → dynamic {
#localTypeVariable#isSet = true;
return localTypeVariable = #t16;
}
final non::method::T? finalLocalTypeVariable;
core::bool #finalLocalTypeVariable#isSet = false;
function #finalLocalTypeVariable#get() → non::method::T
return #finalLocalTypeVariable#isSet ?{non::method::T} finalLocalTypeVariable{non::method::T} : throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has not been initialized.");
function #finalLocalTypeVariable#set(non::method::T #t17) → dynamic
if(#finalLocalTypeVariable#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has already been initialized.");
else {
#finalLocalTypeVariable#isSet = true;
return finalLocalTypeVariable = #t17;
}
if(b) {
#local#set.call(i);
#finalLocal#set.call(i);
#localTypeVariable#set.call(t);
#finalLocalTypeVariable#set.call(t);
non::expect(i, #local#get.call());
non::expect(i, #finalLocal#get.call());
non::expect(t, #localTypeVariable#get.call());
non::expect(t, #finalLocalTypeVariable#get.call());
}
non::throws(() → core::int => #finalLocal#set.call(i));
non::throws(() → non::method::T => #finalLocalTypeVariable#set.call(t));
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
static method throws(() → void f) → dynamic {
try {
f.call();
}
on core::Object catch(final core::Object _) {
return;
}
throw "Missing exception";
}

View file

@ -0,0 +1,183 @@
library;
import self as self;
import "non_nullable_from_opt_out_lib.dart" as non;
import "dart:core" as core;
import "org-dartlang-testcase:///non_nullable_from_opt_out_lib.dart";
static method main() → dynamic {
non::topLevelField = null;
non::finalTopLevelField = null;
non::Class<core::int*>* c = new non::Class::•<core::int*>();
c.{non::Class::instanceField} = null;
c.{non::Class::finalInstanceField} = null;
c.{non::Class::instanceTypeVariable} = null;
c.{non::Class::finalInstanceTypeVariable} = null;
non::Class::staticField = null;
non::Class::staticFinalField = null;
non::expect(null, non::topLevelField);
non::expect(null, non::finalTopLevelField);
non::expect(null, c.{non::Class::instanceField});
non::expect(null, c.{non::Class::finalInstanceField});
non::expect(null, c.{non::Class::instanceTypeVariable});
non::expect(null, c.{non::Class::finalInstanceTypeVariable});
non::expect(null, non::Class::staticField);
non::expect(null, non::Class::staticFinalField);
non::throws(() → core::Null? => non::finalTopLevelField = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceField} = null);
non::throws(() → core::Null? => c.{non::Class::finalInstanceTypeVariable} = null);
non::throws(() → core::Null? => non::Class::staticFinalField = null);
non::method<core::Null?>(true, null, null);
}
library /*isNonNullableByDefault*/;
import self as non;
import "dart:core" as core;
import "dart:_internal" as _in;
class Class<T extends core::Object = core::Object> extends core::Object {
field core::int? _#Class#instanceField = null;
field core::bool _#Class#instanceField#isSet = false;
field dynamic _#Class#finalInstanceField = null;
field core::bool _#Class#finalInstanceField#isSet = false;
generic-covariant-impl field non::Class::T? _#Class#instanceTypeVariable = null;
field core::bool _#Class#instanceTypeVariable#isSet = false;
field non::Class::T? _#Class#finalInstanceTypeVariable = null;
field core::bool _#Class#finalInstanceTypeVariable#isSet = false;
static field core::int? _#staticField = null;
static field core::bool _#staticField#isSet = false;
static field dynamic _#staticFinalField = null;
static field core::bool _#staticFinalField#isSet = false;
synthetic constructor •() → non::Class<non::Class::T>
: super core::Object::•()
;
get instanceField() → core::int
return this.{non::Class::_#Class#instanceField#isSet} ?{core::int} let final core::int? #t1 = this.{non::Class::_#Class#instanceField} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceField' has not been initialized.");
set instanceField(core::int #t2) → void {
this.{non::Class::_#Class#instanceField#isSet} = true;
this.{non::Class::_#Class#instanceField} = #t2;
}
get finalInstanceField() → dynamic
return this.{non::Class::_#Class#finalInstanceField#isSet} ?{dynamic} this.{non::Class::_#Class#finalInstanceField} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has not been initialized.");
set finalInstanceField(dynamic #t3) → void
if(this.{non::Class::_#Class#finalInstanceField#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceField' has already been initialized.");
else {
this.{non::Class::_#Class#finalInstanceField#isSet} = true;
this.{non::Class::_#Class#finalInstanceField} = #t3;
}
get instanceTypeVariable() → non::Class::T
return this.{non::Class::_#Class#instanceTypeVariable#isSet} ?{non::Class::T} let final non::Class::T? #t4 = this.{non::Class::_#Class#instanceTypeVariable} in #t4{non::Class::T} : throw new _in::LateInitializationErrorImpl::•("Field 'instanceTypeVariable' has not been initialized.");
set instanceTypeVariable(generic-covariant-impl non::Class::T #t5) → void {
this.{non::Class::_#Class#instanceTypeVariable#isSet} = true;
this.{non::Class::_#Class#instanceTypeVariable} = #t5;
}
get finalInstanceTypeVariable() → non::Class::T
return this.{non::Class::_#Class#finalInstanceTypeVariable#isSet} ?{non::Class::T} let final non::Class::T? #t6 = this.{non::Class::_#Class#finalInstanceTypeVariable} in #t6{non::Class::T} : throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has not been initialized.");
set finalInstanceTypeVariable(non::Class::T #t7) → void
if(this.{non::Class::_#Class#finalInstanceTypeVariable#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'finalInstanceTypeVariable' has already been initialized.");
else {
this.{non::Class::_#Class#finalInstanceTypeVariable#isSet} = true;
this.{non::Class::_#Class#finalInstanceTypeVariable} = #t7;
}
static get staticField() → core::int
return non::Class::_#staticField#isSet ?{core::int} let final core::int? #t8 = non::Class::_#staticField in #t8{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'staticField' has not been initialized.");
static set staticField(core::int #t9) → void {
non::Class::_#staticField#isSet = true;
non::Class::_#staticField = #t9;
}
static get staticFinalField() → dynamic
return non::Class::_#staticFinalField#isSet ?{dynamic} non::Class::_#staticFinalField : throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has not been initialized.");
static set staticFinalField(dynamic #t10) → void
if(non::Class::_#staticFinalField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'staticFinalField' has already been initialized.");
else {
non::Class::_#staticFinalField#isSet = true;
non::Class::_#staticFinalField = #t10;
}
}
static field core::int? _#topLevelField = null;
static field core::bool _#topLevelField#isSet = false;
static field dynamic _#finalTopLevelField = null;
static field core::bool _#finalTopLevelField#isSet = false;
static get topLevelField() → core::int
return non::_#topLevelField#isSet ?{core::int} let final core::int? #t11 = non::_#topLevelField in #t11{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'topLevelField' has not been initialized.");
static set topLevelField(core::int #t12) → void {
non::_#topLevelField#isSet = true;
non::_#topLevelField = #t12;
}
static get finalTopLevelField() → dynamic
return non::_#finalTopLevelField#isSet ?{dynamic} non::_#finalTopLevelField : throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has not been initialized.");
static set finalTopLevelField(dynamic #t13) → void
if(non::_#finalTopLevelField#isSet)
throw new _in::LateInitializationErrorImpl::•("Field 'finalTopLevelField' has already been initialized.");
else {
non::_#finalTopLevelField#isSet = true;
non::_#finalTopLevelField = #t13;
}
static method method<T extends core::Object = core::Object>(core::bool b, core::int i, non::method::T t) → dynamic {
core::int? local;
core::bool #local#isSet = false;
function #local#get() → core::int
return #local#isSet ?{core::int} local{core::int} : throw new _in::LateInitializationErrorImpl::•("Local 'local' has not been initialized.");
function #local#set(core::int #t14) → dynamic {
#local#isSet = true;
return local = #t14;
}
final dynamic finalLocal;
core::bool #finalLocal#isSet = false;
function #finalLocal#get() → dynamic
return #finalLocal#isSet ?{dynamic} finalLocal : throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has not been initialized.");
function #finalLocal#set(dynamic #t15) → dynamic
if(#finalLocal#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocal' has already been initialized.");
else {
#finalLocal#isSet = true;
return finalLocal = #t15;
}
non::method::T? localTypeVariable;
core::bool #localTypeVariable#isSet = false;
function #localTypeVariable#get() → non::method::T
return #localTypeVariable#isSet ?{non::method::T} localTypeVariable{non::method::T} : throw new _in::LateInitializationErrorImpl::•("Local 'localTypeVariable' has not been initialized.");
function #localTypeVariable#set(non::method::T #t16) → dynamic {
#localTypeVariable#isSet = true;
return localTypeVariable = #t16;
}
final non::method::T? finalLocalTypeVariable;
core::bool #finalLocalTypeVariable#isSet = false;
function #finalLocalTypeVariable#get() → non::method::T
return #finalLocalTypeVariable#isSet ?{non::method::T} finalLocalTypeVariable{non::method::T} : throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has not been initialized.");
function #finalLocalTypeVariable#set(non::method::T #t17) → dynamic
if(#finalLocalTypeVariable#isSet)
throw new _in::LateInitializationErrorImpl::•("Local 'finalLocalTypeVariable' has already been initialized.");
else {
#finalLocalTypeVariable#isSet = true;
return finalLocalTypeVariable = #t17;
}
if(b) {
#local#set.call(i);
#finalLocal#set.call(i);
#localTypeVariable#set.call(t);
#finalLocalTypeVariable#set.call(t);
non::expect(i, #local#get.call());
non::expect(i, #finalLocal#get.call());
non::expect(t, #localTypeVariable#get.call());
non::expect(t, #finalLocalTypeVariable#get.call());
}
non::throws(() → core::int => #finalLocal#set.call(i));
non::throws(() → non::method::T => #finalLocalTypeVariable#set.call(t));
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
static method throws(() → void f) → dynamic {
try {
f.call();
}
on core::Object catch(final core::Object _) {
return;
}
throw "Missing exception";
}

View file

@ -0,0 +1,52 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
late int topLevelField;
late final finalTopLevelField;
class Class<T extends Object> {
late int instanceField;
late final finalInstanceField;
late T instanceTypeVariable;
late final T finalInstanceTypeVariable;
static late int staticField;
static late final staticFinalField;
}
method<T extends Object>(bool b, int i, T t) {
late int local;
late final finalLocal;
late T localTypeVariable;
late final T finalLocalTypeVariable;
if (b) {
// Ensure assignments below are not definitely assigned.
local = i;
finalLocal = i;
localTypeVariable = t;
finalLocalTypeVariable = t;
expect(i, local);
expect(i, finalLocal);
expect(t, localTypeVariable);
expect(t, finalLocalTypeVariable);
}
throws(() => finalLocal = i);
throws(() => finalLocalTypeVariable = t);
}
expect(expected, actual) {
if (expected != actual) throw 'Expected $expected, actual $actual';
}
throws(void Function() f) {
try {
f();
} catch (_) {
return;
}
throw 'Missing exception';
}

View file

@ -5,58 +5,85 @@ import "dart:_internal" as _in;
class Class extends core::Object {
field core::int? _#Class#field1 = null;
field core::bool _#Class#field1#isSet = false;
field core::int? _#Class#field2 = null;
field core::bool _#Class#field2#isSet = false;
field core::int? _#Class#field3 = null;
field core::bool _#Class#field3#isSet = false;
field core::int? _#Class#field4 = null;
field core::bool _#Class#field4#isSet = false;
synthetic constructor •() → self::Class
: super core::Object::•()
;
get field1() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field1} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.") : #t1{core::int};
set field1(core::int #t2) → void
return this.{self::Class::_#Class#field1#isSet} ?{core::int} let final core::int? #t1 = this.{self::Class::_#Class#field1} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
set field1(core::int #t2) → void {
this.{self::Class::_#Class#field1#isSet} = true;
this.{self::Class::_#Class#field1} = #t2;
}
get field2() → core::int
return let final core::int? #t3 = this.{self::Class::_#Class#field2} in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.") : #t3{core::int};
set field2(core::int #t4) → void
return this.{self::Class::_#Class#field2#isSet} ?{core::int} let final core::int? #t3 = this.{self::Class::_#Class#field2} in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
set field2(core::int #t4) → void {
this.{self::Class::_#Class#field2#isSet} = true;
this.{self::Class::_#Class#field2} = #t4;
}
get field3() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#field3} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.") : #t5{core::int};
return this.{self::Class::_#Class#field3#isSet} ?{core::int} let final core::int? #t5 = this.{self::Class::_#Class#field3} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
set field3(core::int #t6) → void
if(this.{self::Class::_#Class#field3}.==(null))
this.{self::Class::_#Class#field3} = #t6;
else
if(this.{self::Class::_#Class#field3#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field3' has already been initialized.");
else {
this.{self::Class::_#Class#field3#isSet} = true;
this.{self::Class::_#Class#field3} = #t6;
}
get field4() → core::int
return let final core::int? #t7 = this.{self::Class::_#Class#field4} in #t7.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.") : #t7{core::int};
return this.{self::Class::_#Class#field4#isSet} ?{core::int} let final core::int? #t7 = this.{self::Class::_#Class#field4} in #t7{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
set field4(core::int #t8) → void
if(this.{self::Class::_#Class#field4}.==(null))
this.{self::Class::_#Class#field4} = #t8;
else
if(this.{self::Class::_#Class#field4#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field4' has already been initialized.");
else {
this.{self::Class::_#Class#field4#isSet} = true;
this.{self::Class::_#Class#field4} = #t8;
}
}
class SubClass extends self::Class {
field core::int? _#SubClass#field1 = null;
field core::bool _#SubClass#field1#isSet = false;
field core::int? _#SubClass#field2 = null;
field core::bool _#SubClass#field2#isSet = false;
field core::int? _#SubClass#field3 = null;
field core::bool _#SubClass#field3#isSet = false;
field core::int? _#SubClass#field4 = null;
field core::bool _#SubClass#field4#isSet = false;
synthetic constructor •() → self::SubClass
: super self::Class::•()
;
get field1() → core::int
return let final core::int? #t9 = this.{self::SubClass::_#SubClass#field1} in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.") : #t9{core::int};
set field1(core::int #t10) → void
return this.{self::SubClass::_#SubClass#field1#isSet} ?{core::int} let final core::int? #t9 = this.{self::SubClass::_#SubClass#field1} in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
set field1(core::int #t10) → void {
this.{self::SubClass::_#SubClass#field1#isSet} = true;
this.{self::SubClass::_#SubClass#field1} = #t10;
get field2() → core::int
return let final core::int? #t11 = this.{self::SubClass::_#SubClass#field2} in #t11.==(null) ?{core::int} this.{self::SubClass::_#SubClass#field2} = 0 : #t11{core::int};
set field2(core::int #t12) → void
}
get field2() → core::int {
if(!this.{self::SubClass::_#SubClass#field2#isSet}) {
this.{self::SubClass::_#SubClass#field2} = 0;
this.{self::SubClass::_#SubClass#field2#isSet} = true;
}
return let final core::int? #t11 = this.{self::SubClass::_#SubClass#field2} in #t11{core::int};
}
set field2(core::int #t12) → void {
this.{self::SubClass::_#SubClass#field2#isSet} = true;
this.{self::SubClass::_#SubClass#field2} = #t12;
}
get field3() → core::int
return let final core::int? #t13 = this.{self::SubClass::_#SubClass#field3} in #t13.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.") : #t13{core::int};
return this.{self::SubClass::_#SubClass#field3#isSet} ?{core::int} let final core::int? #t13 = this.{self::SubClass::_#SubClass#field3} in #t13{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
set field3(core::int #t14) → void
if(this.{self::SubClass::_#SubClass#field3}.==(null))
this.{self::SubClass::_#SubClass#field3} = #t14;
else
if(this.{self::SubClass::_#SubClass#field3#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field3' has already been initialized.");
else {
this.{self::SubClass::_#SubClass#field3#isSet} = true;
this.{self::SubClass::_#SubClass#field3} = #t14;
}
get field4() → core::int
return let final core::int? #t15 = this.{self::SubClass::_#SubClass#field4} in #t15.==(null) ?{core::int} let final core::int #t16 = 0 in this.{self::SubClass::_#SubClass#field4}.==(null) ?{core::int} this.{self::SubClass::_#SubClass#field4} = #t16 : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has been assigned during initialization.") : #t15{core::int};
get directField1() → core::int

View file

@ -5,58 +5,85 @@ import "dart:_internal" as _in;
class Class extends core::Object {
field core::int? _#Class#field1 = null;
field core::bool _#Class#field1#isSet = false;
field core::int? _#Class#field2 = null;
field core::bool _#Class#field2#isSet = false;
field core::int? _#Class#field3 = null;
field core::bool _#Class#field3#isSet = false;
field core::int? _#Class#field4 = null;
field core::bool _#Class#field4#isSet = false;
synthetic constructor •() → self::Class
: super core::Object::•()
;
get field1() → core::int
return let final core::int? #t1 = this.{self::Class::_#Class#field1} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.") : #t1{core::int};
set field1(core::int #t2) → void
return this.{self::Class::_#Class#field1#isSet} ?{core::int} let final core::int? #t1 = this.{self::Class::_#Class#field1} in #t1{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
set field1(core::int #t2) → void {
this.{self::Class::_#Class#field1#isSet} = true;
this.{self::Class::_#Class#field1} = #t2;
}
get field2() → core::int
return let final core::int? #t3 = this.{self::Class::_#Class#field2} in #t3.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.") : #t3{core::int};
set field2(core::int #t4) → void
return this.{self::Class::_#Class#field2#isSet} ?{core::int} let final core::int? #t3 = this.{self::Class::_#Class#field2} in #t3{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field2' has not been initialized.");
set field2(core::int #t4) → void {
this.{self::Class::_#Class#field2#isSet} = true;
this.{self::Class::_#Class#field2} = #t4;
}
get field3() → core::int
return let final core::int? #t5 = this.{self::Class::_#Class#field3} in #t5.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.") : #t5{core::int};
return this.{self::Class::_#Class#field3#isSet} ?{core::int} let final core::int? #t5 = this.{self::Class::_#Class#field3} in #t5{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
set field3(core::int #t6) → void
if(this.{self::Class::_#Class#field3}.==(null))
this.{self::Class::_#Class#field3} = #t6;
else
if(this.{self::Class::_#Class#field3#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field3' has already been initialized.");
else {
this.{self::Class::_#Class#field3#isSet} = true;
this.{self::Class::_#Class#field3} = #t6;
}
get field4() → core::int
return let final core::int? #t7 = this.{self::Class::_#Class#field4} in #t7.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.") : #t7{core::int};
return this.{self::Class::_#Class#field4#isSet} ?{core::int} let final core::int? #t7 = this.{self::Class::_#Class#field4} in #t7{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has not been initialized.");
set field4(core::int #t8) → void
if(this.{self::Class::_#Class#field4}.==(null))
this.{self::Class::_#Class#field4} = #t8;
else
if(this.{self::Class::_#Class#field4#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field4' has already been initialized.");
else {
this.{self::Class::_#Class#field4#isSet} = true;
this.{self::Class::_#Class#field4} = #t8;
}
}
class SubClass extends self::Class {
field core::int? _#SubClass#field1 = null;
field core::bool _#SubClass#field1#isSet = false;
field core::int? _#SubClass#field2 = null;
field core::bool _#SubClass#field2#isSet = false;
field core::int? _#SubClass#field3 = null;
field core::bool _#SubClass#field3#isSet = false;
field core::int? _#SubClass#field4 = null;
field core::bool _#SubClass#field4#isSet = false;
synthetic constructor •() → self::SubClass
: super self::Class::•()
;
get field1() → core::int
return let final core::int? #t9 = this.{self::SubClass::_#SubClass#field1} in #t9.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.") : #t9{core::int};
set field1(core::int #t10) → void
return this.{self::SubClass::_#SubClass#field1#isSet} ?{core::int} let final core::int? #t9 = this.{self::SubClass::_#SubClass#field1} in #t9{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field1' has not been initialized.");
set field1(core::int #t10) → void {
this.{self::SubClass::_#SubClass#field1#isSet} = true;
this.{self::SubClass::_#SubClass#field1} = #t10;
get field2() → core::int
return let final core::int? #t11 = this.{self::SubClass::_#SubClass#field2} in #t11.==(null) ?{core::int} this.{self::SubClass::_#SubClass#field2} = 0 : #t11{core::int};
set field2(core::int #t12) → void
}
get field2() → core::int {
if(!this.{self::SubClass::_#SubClass#field2#isSet}) {
this.{self::SubClass::_#SubClass#field2} = 0;
this.{self::SubClass::_#SubClass#field2#isSet} = true;
}
return let final core::int? #t11 = this.{self::SubClass::_#SubClass#field2} in #t11{core::int};
}
set field2(core::int #t12) → void {
this.{self::SubClass::_#SubClass#field2#isSet} = true;
this.{self::SubClass::_#SubClass#field2} = #t12;
}
get field3() → core::int
return let final core::int? #t13 = this.{self::SubClass::_#SubClass#field3} in #t13.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.") : #t13{core::int};
return this.{self::SubClass::_#SubClass#field3#isSet} ?{core::int} let final core::int? #t13 = this.{self::SubClass::_#SubClass#field3} in #t13{core::int} : throw new _in::LateInitializationErrorImpl::•("Field 'field3' has not been initialized.");
set field3(core::int #t14) → void
if(this.{self::SubClass::_#SubClass#field3}.==(null))
this.{self::SubClass::_#SubClass#field3} = #t14;
else
if(this.{self::SubClass::_#SubClass#field3#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'field3' has already been initialized.");
else {
this.{self::SubClass::_#SubClass#field3#isSet} = true;
this.{self::SubClass::_#SubClass#field3} = #t14;
}
get field4() → core::int
return let final core::int? #t15 = this.{self::SubClass::_#SubClass#field4} in #t15.==(null) ?{core::int} let final core::int #t16 = 0 in this.{self::SubClass::_#SubClass#field4}.==(null) ?{core::int} this.{self::SubClass::_#SubClass#field4} = #t16 : throw new _in::LateInitializationErrorImpl::•("Field 'field4' has been assigned during initialization.") : #t15{core::int};
get directField1() → core::int

View file

@ -5,18 +5,21 @@ import "dart:_internal" as _in;
class A extends core::Object {
field core::int? _#A#x = null;
field core::bool _#A#x#isSet = false;
field core::int? _#A#y = null;
field core::bool _#A#y#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{self::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{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::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void
if(this.{self::A::_#A#x}.==(null))
this.{self::A::_#A#x} = #t2;
else
if(this.{self::A::_#A#x#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'x' has already been initialized.");
else {
this.{self::A::_#A#x#isSet} = true;
this.{self::A::_#A#x} = #t2;
}
get y() → core::int?
return this.{self::A::_#A#y#isSet} ?{core::int?} this.{self::A::_#A#y} : throw new _in::LateInitializationErrorImpl::•("Field 'y' has not been initialized.");
set y(core::int? #t3) → void
@ -38,6 +41,7 @@ class B extends self::A {
}
class C extends self::A {
field core::int? _#C#x = null;
field core::bool _#C#x#isSet = false;
field core::int? _#C#y = null;
field core::bool _#C#y#isSet = false;
synthetic constructor •() → self::C

View file

@ -5,18 +5,21 @@ import "dart:_internal" as _in;
class A extends core::Object {
field core::int? _#A#x = null;
field core::bool _#A#x#isSet = false;
field core::int? _#A#y = null;
field core::bool _#A#y#isSet = false;
synthetic constructor •() → self::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{self::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{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::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void
if(this.{self::A::_#A#x}.==(null))
this.{self::A::_#A#x} = #t2;
else
if(this.{self::A::_#A#x#isSet})
throw new _in::LateInitializationErrorImpl::•("Field 'x' has already been initialized.");
else {
this.{self::A::_#A#x#isSet} = true;
this.{self::A::_#A#x} = #t2;
}
get y() → core::int?
return this.{self::A::_#A#y#isSet} ?{core::int?} this.{self::A::_#A#y} : throw new _in::LateInitializationErrorImpl::•("Field 'y' has not been initialized.");
set y(core::int? #t3) → void
@ -38,6 +41,7 @@ class B extends self::A {
}
class C extends self::A {
field core::int? _#C#x = null;
field core::bool _#C#x#isSet = false;
field core::int? _#C#y = null;
field core::bool _#C#y#isSet = false;
synthetic constructor •() → self::C

View file

@ -26,10 +26,18 @@ class Class<E extends core::Object? = dynamic> extends core::Object {
}
static method returnNonNullable(core::int value) → core::int {
core::int? result;
function #result#get() → core::int
return let final core::int? #t2 = result in #t2.==(null) ?{core::int} result = value : #t2{core::int};
function #result#set(core::int #t3) → dynamic
return result = #t3;
core::bool #result#isSet = false;
function #result#get() → core::int {
if(!#result#isSet) {
result = value;
#result#isSet = true;
}
return result{core::int};
}
function #result#set(core::int #t2) → dynamic {
#result#isSet = true;
return result = #t2;
}
return #result#get.call();
}
static method returnNullable(core::int? value) → core::int? {
@ -42,9 +50,9 @@ static method returnNullable(core::int? value) → core::int? {
}
return result;
}
function #result#set(core::int? #t4) → dynamic {
function #result#set(core::int? #t3) → dynamic {
#result#isSet = true;
return result = #t4;
return result = #t3;
}
return #result#get.call();
}

View file

@ -26,10 +26,18 @@ class Class<E extends core::Object? = dynamic> extends core::Object {
}
static method returnNonNullable(core::int value) → core::int {
core::int? result;
function #result#get() → core::int
return let final core::int? #t2 = result in #t2.==(null) ?{core::int} result = value : #t2{core::int};
function #result#set(core::int #t3) → dynamic
return result = #t3;
core::bool #result#isSet = false;
function #result#get() → core::int {
if(!#result#isSet) {
result = value;
#result#isSet = true;
}
return result{core::int};
}
function #result#set(core::int #t2) → dynamic {
#result#isSet = true;
return result = #t2;
}
return #result#get.call();
}
static method returnNullable(core::int? value) → core::int? {
@ -42,9 +50,9 @@ static method returnNullable(core::int? value) → core::int? {
}
return result;
}
function #result#set(core::int? #t4) → dynamic {
function #result#set(core::int? #t3) → dynamic {
#result#isSet = true;
return result = #t4;
return result = #t3;
}
return #result#get.call();
}

View file

@ -5,15 +5,18 @@ import "dart:_internal" as _in;
class A extends core::Object {
field core::int? _#A#x = null;
field core::bool _#A#x#isSet = false;
constructor foo(core::int x) → self::A
: self::A::_#A#x = x, super core::Object::•()
: self::A::_#A#x#isSet = true, self::A::_#A#x = x, super core::Object::•()
;
constructor bar() → self::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{self::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
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::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void {
this.{self::A::_#A#x#isSet} = true;
this.{self::A::_#A#x} = #t2;
}
}
static method main() → dynamic {}

View file

@ -5,15 +5,18 @@ import "dart:_internal" as _in;
class A extends core::Object {
field core::int? _#A#x = null;
field core::bool _#A#x#isSet = false;
constructor foo(core::int x) → self::A
: self::A::_#A#x = x, super core::Object::•()
: self::A::_#A#x#isSet = true, self::A::_#A#x = x, super core::Object::•()
;
constructor bar() → self::A
: super core::Object::•()
;
get x() → core::int
return let final core::int? #t1 = this.{self::A::_#A#x} in #t1.==(null) ?{core::int} throw new _in::LateInitializationErrorImpl::•("Field 'x' has not been initialized.") : #t1{core::int};
set x(core::int #t2) → void
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::LateInitializationErrorImpl::•("Field 'x' has not been initialized.");
set x(core::int #t2) → void {
this.{self::A::_#A#x#isSet} = true;
this.{self::A::_#A#x} = #t2;
}
}
static method main() → dynamic {}

View file

@ -9,26 +9,39 @@ class Class extends core::Object {
field core::int nonNullableInstanceFieldWithInitializer = self::init<core::int>(55);
field core::int? nullableInstanceFieldWithInitializer = self::init<core::int?>(17);
static field core::int? _#nonNullableStaticFieldWithInitializer1 = null;
static field core::bool _#nonNullableStaticFieldWithInitializer1#isSet = false;
static field core::int? _#nullableStaticFieldWithInitializer1 = null;
static field core::bool _#nullableStaticFieldWithInitializer1#isSet = false;
static field core::int? _#nonNullableStaticFieldWithInitializer2 = null;
static field core::bool _#nonNullableStaticFieldWithInitializer2#isSet = false;
static field core::int? _#nullableStaticFieldWithInitializer2 = null;
static field core::bool _#nullableStaticFieldWithInitializer2#isSet = false;
static field core::int? _#nonNullableStaticFinalFieldWithInitializer1 = null;
static field core::bool _#nonNullableStaticFinalFieldWithInitializer1#isSet = false;
static field core::int? _#nullableStaticFinalFieldWithInitializer1 = null;
static field core::bool _#nullableStaticFinalFieldWithInitializer1#isSet = false;
static field core::int? _#nonNullableStaticFinalFieldWithInitializer2Init = null;
static field core::bool _#nonNullableStaticFinalFieldWithInitializer2Init#isSet = false;
static field core::int? _#nonNullableStaticFinalFieldWithInitializer2 = null;
static field core::bool _#nonNullableStaticFinalFieldWithInitializer2#isSet = false;
static field core::int? _#nullableStaticFinalFieldWithInitializer2Init = null;
static field core::bool _#nullableStaticFinalFieldWithInitializer2Init#isSet = false;
static field core::int? _#nullableStaticFinalFieldWithInitializer2 = null;
static field core::bool _#nullableStaticFinalFieldWithInitializer2#isSet = false;
synthetic constructor •() → self::Class
: super core::Object::•()
;
static get nonNullableStaticFieldWithInitializer1() → core::int
return let final core::int? #t1 = self::Class::_#nonNullableStaticFieldWithInitializer1 in #t1.==(null) ?{core::int} self::Class::_#nonNullableStaticFieldWithInitializer1 = self::init<core::int>(55) : #t1{core::int};
static set nonNullableStaticFieldWithInitializer1(core::int #t2) → void
static get nonNullableStaticFieldWithInitializer1() → core::int {
if(!self::Class::_#nonNullableStaticFieldWithInitializer1#isSet) {
self::Class::_#nonNullableStaticFieldWithInitializer1 = self::init<core::int>(55);
self::Class::_#nonNullableStaticFieldWithInitializer1#isSet = true;
}
return let final core::int? #t1 = self::Class::_#nonNullableStaticFieldWithInitializer1 in #t1{core::int};
}
static set nonNullableStaticFieldWithInitializer1(core::int #t2) → void {
self::Class::_#nonNullableStaticFieldWithInitializer1#isSet = true;
self::Class::_#nonNullableStaticFieldWithInitializer1 = #t2;
}
static get nullableStaticFieldWithInitializer1() → core::int? {
if(!self::Class::_#nullableStaticFieldWithInitializer1#isSet) {
self::Class::_#nullableStaticFieldWithInitializer1 = self::init<core::int?>(17);
@ -40,10 +53,17 @@ class Class extends core::Object {
self::Class::_#nullableStaticFieldWithInitializer1#isSet = true;
self::Class::_#nullableStaticFieldWithInitializer1 = #t3;
}
static get nonNullableStaticFieldWithInitializer2() → core::int
return let final core::int? #t4 = self::Class::_#nonNullableStaticFieldWithInitializer2 in #t4.==(null) ?{core::int} self::Class::_#nonNullableStaticFieldWithInitializer2 = self::init<core::int>(55) : #t4{core::int};
static set nonNullableStaticFieldWithInitializer2(core::int #t5) → void
static get nonNullableStaticFieldWithInitializer2() → core::int {
if(!self::Class::_#nonNullableStaticFieldWithInitializer2#isSet) {
self::Class::_#nonNullableStaticFieldWithInitializer2 = self::init<core::int>(55);
self::Class::_#nonNullableStaticFieldWithInitializer2#isSet = true;
}
return let final core::int? #t4 = self::Class::_#nonNullableStaticFieldWithInitializer2 in #t4{core::int};
}
static set nonNullableStaticFieldWithInitializer2(core::int #t5) → void {
self::Class::_#nonNullableStaticFieldWithInitializer2#isSet = true;
self::Class::_#nonNullableStaticFieldWithInitializer2 = #t5;
}
static get nullableStaticFieldWithInitializer2() → core::int? {
if(!self::Class::_#nullableStaticFieldWithInitializer2#isSet) {
self::Class::_#nullableStaticFieldWithInitializer2 = self::init<core::int?>(17);
@ -67,16 +87,30 @@ class Class extends core::Object {
}
return self::Class::_#nullableStaticFinalFieldWithInitializer1;
}
static get nonNullableStaticFinalFieldWithInitializer2Init() → core::int
return let final core::int? #t10 = self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init in #t10.==(null) ?{core::int} self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init = 0 : #t10{core::int};
static set nonNullableStaticFinalFieldWithInitializer2Init(core::int #t11) → void
static get nonNullableStaticFinalFieldWithInitializer2Init() → core::int {
if(!self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init#isSet) {
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init = 0;
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t10 = self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init in #t10{core::int};
}
static set nonNullableStaticFinalFieldWithInitializer2Init(core::int #t11) → void {
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init#isSet = true;
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init = #t11;
}
static get nonNullableStaticFinalFieldWithInitializer2() → core::int
return let final core::int? #t12 = self::Class::_#nonNullableStaticFinalFieldWithInitializer2 in #t12.==(null) ?{core::int} let final core::int #t13 = (let final core::int #t14 = self::Class::nonNullableStaticFinalFieldWithInitializer2Init in let final core::int #t15 = self::Class::nonNullableStaticFinalFieldWithInitializer2Init = #t14.{core::num::+}(1) in #t14).{core::num::==}(0) ?{core::int} self::Class::nonNullableStaticFinalFieldWithInitializer2.{core::num::+}(1) : 87 in self::Class::_#nonNullableStaticFinalFieldWithInitializer2.==(null) ?{core::int} self::Class::_#nonNullableStaticFinalFieldWithInitializer2 = #t13 : throw new _in::LateInitializationErrorImpl::•("Field 'nonNullableStaticFinalFieldWithInitializer2' has been assigned during initialization.") : #t12{core::int};
static get nullableStaticFinalFieldWithInitializer2Init() → core::int
return let final core::int? #t16 = self::Class::_#nullableStaticFinalFieldWithInitializer2Init in #t16.==(null) ?{core::int} self::Class::_#nullableStaticFinalFieldWithInitializer2Init = 0 : #t16{core::int};
static set nullableStaticFinalFieldWithInitializer2Init(core::int #t17) → void
static get nullableStaticFinalFieldWithInitializer2Init() → core::int {
if(!self::Class::_#nullableStaticFinalFieldWithInitializer2Init#isSet) {
self::Class::_#nullableStaticFinalFieldWithInitializer2Init = 0;
self::Class::_#nullableStaticFinalFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t16 = self::Class::_#nullableStaticFinalFieldWithInitializer2Init in #t16{core::int};
}
static set nullableStaticFinalFieldWithInitializer2Init(core::int #t17) → void {
self::Class::_#nullableStaticFinalFieldWithInitializer2Init#isSet = true;
self::Class::_#nullableStaticFinalFieldWithInitializer2Init = #t17;
}
static get nullableStaticFinalFieldWithInitializer2() → core::int? {
if(!self::Class::_#nullableStaticFinalFieldWithInitializer2#isSet) {
final core::int? #t18 = (let final core::int #t19 = self::Class::nullableStaticFinalFieldWithInitializer2Init in let final core::int #t20 = self::Class::nullableStaticFinalFieldWithInitializer2Init = #t19.{core::num::+}(1) in #t19).{core::num::==}(0) ?{core::int} self::Class::nullableStaticFinalFieldWithInitializer2!.{core::num::+}(1) : 32;
@ -92,27 +126,40 @@ static field dynamic lastInit;
static const field core::int constTopLevelField = #C2;
static field core::int? topLevelFieldWithoutInitializer;
static field core::int? _#nonNullableTopLevelFieldWithInitializer1 = null;
static field core::bool _#nonNullableTopLevelFieldWithInitializer1#isSet = false;
static field core::int? _#nullableTopLevelFieldWithInitializer = null;
static field core::bool _#nullableTopLevelFieldWithInitializer#isSet = false;
static field core::int? _#nonNullableTopLevelFieldWithInitializer2 = null;
static field core::bool _#nonNullableTopLevelFieldWithInitializer2#isSet = false;
static field core::int? _#nullableTopLevelFieldWithInitializer2 = null;
static field core::bool _#nullableTopLevelFieldWithInitializer2#isSet = false;
static field core::int? _#nonNullableFinalTopLevelFieldWithInitializer1 = null;
static field core::bool _#nonNullableFinalTopLevelFieldWithInitializer1#isSet = false;
static field core::int? _#nullableFinalTopLevelFieldWithInitializer1 = null;
static field core::bool _#nullableFinalTopLevelFieldWithInitializer1#isSet = false;
static field core::int? _#nonNullableFinalTopLevelFieldWithInitializer2Init = null;
static field core::bool _#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet = false;
static field core::int? _#nonNullableFinalTopLevelFieldWithInitializer2 = null;
static field core::bool _#nonNullableFinalTopLevelFieldWithInitializer2#isSet = false;
static field core::int? _#nullableFinalTopLevelFieldWithInitializer2Init = null;
static field core::bool _#nullableFinalTopLevelFieldWithInitializer2Init#isSet = false;
static field core::int? _#nullableFinalTopLevelFieldWithInitializer2 = null;
static field core::bool _#nullableFinalTopLevelFieldWithInitializer2#isSet = false;
static method init<T extends core::Object? = dynamic>(self::init::T% value) → self::init::T% {
self::lastInit = value;
return value;
}
static get nonNullableTopLevelFieldWithInitializer1() → core::int
return let final core::int? #t21 = self::_#nonNullableTopLevelFieldWithInitializer1 in #t21.==(null) ?{core::int} self::_#nonNullableTopLevelFieldWithInitializer1 = self::init<core::int>(42) : #t21{core::int};
static set nonNullableTopLevelFieldWithInitializer1(core::int #t22) → void
static get nonNullableTopLevelFieldWithInitializer1() → core::int {
if(!self::_#nonNullableTopLevelFieldWithInitializer1#isSet) {
self::_#nonNullableTopLevelFieldWithInitializer1 = self::init<core::int>(42);
self::_#nonNullableTopLevelFieldWithInitializer1#isSet = true;
}
return let final core::int? #t21 = self::_#nonNullableTopLevelFieldWithInitializer1 in #t21{core::int};
}
static set nonNullableTopLevelFieldWithInitializer1(core::int #t22) → void {
self::_#nonNullableTopLevelFieldWithInitializer1#isSet = true;
self::_#nonNullableTopLevelFieldWithInitializer1 = #t22;
}
static get nullableTopLevelFieldWithInitializer() → core::int? {
if(!self::_#nullableTopLevelFieldWithInitializer#isSet) {
self::_#nullableTopLevelFieldWithInitializer = self::init<core::int?>(123);
@ -124,10 +171,17 @@ static set nullableTopLevelFieldWithInitializer(core::int? #t23) → void {
self::_#nullableTopLevelFieldWithInitializer#isSet = true;
self::_#nullableTopLevelFieldWithInitializer = #t23;
}
static get nonNullableTopLevelFieldWithInitializer2() → core::int
return let final core::int? #t24 = self::_#nonNullableTopLevelFieldWithInitializer2 in #t24.==(null) ?{core::int} self::_#nonNullableTopLevelFieldWithInitializer2 = self::init<core::int>(42) : #t24{core::int};
static set nonNullableTopLevelFieldWithInitializer2(core::int #t25) → void
static get nonNullableTopLevelFieldWithInitializer2() → core::int {
if(!self::_#nonNullableTopLevelFieldWithInitializer2#isSet) {
self::_#nonNullableTopLevelFieldWithInitializer2 = self::init<core::int>(42);
self::_#nonNullableTopLevelFieldWithInitializer2#isSet = true;
}
return let final core::int? #t24 = self::_#nonNullableTopLevelFieldWithInitializer2 in #t24{core::int};
}
static set nonNullableTopLevelFieldWithInitializer2(core::int #t25) → void {
self::_#nonNullableTopLevelFieldWithInitializer2#isSet = true;
self::_#nonNullableTopLevelFieldWithInitializer2 = #t25;
}
static get nullableTopLevelFieldWithInitializer2() → core::int? {
if(!self::_#nullableTopLevelFieldWithInitializer2#isSet) {
self::_#nullableTopLevelFieldWithInitializer2 = self::init<core::int?>(123);
@ -151,16 +205,30 @@ static get nullableFinalTopLevelFieldWithInitializer1() → core::int? {
}
return self::_#nullableFinalTopLevelFieldWithInitializer1;
}
static get nonNullableFinalTopLevelFieldWithInitializer2Init() → core::int
return let final core::int? #t30 = self::_#nonNullableFinalTopLevelFieldWithInitializer2Init in #t30.==(null) ?{core::int} self::_#nonNullableFinalTopLevelFieldWithInitializer2Init = 0 : #t30{core::int};
static set nonNullableFinalTopLevelFieldWithInitializer2Init(core::int #t31) → void
static get nonNullableFinalTopLevelFieldWithInitializer2Init() → core::int {
if(!self::_#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet) {
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init = 0;
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t30 = self::_#nonNullableFinalTopLevelFieldWithInitializer2Init in #t30{core::int};
}
static set nonNullableFinalTopLevelFieldWithInitializer2Init(core::int #t31) → void {
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init = #t31;
}
static get nonNullableFinalTopLevelFieldWithInitializer2() → core::int
return let final core::int? #t32 = self::_#nonNullableFinalTopLevelFieldWithInitializer2 in #t32.==(null) ?{core::int} let final core::int #t33 = (let final core::int #t34 = self::nonNullableFinalTopLevelFieldWithInitializer2Init in let final core::int #t35 = self::nonNullableFinalTopLevelFieldWithInitializer2Init = #t34.{core::num::+}(1) in #t34).{core::num::==}(0) ?{core::int} self::nonNullableFinalTopLevelFieldWithInitializer2.{core::num::+}(1) : 87 in self::_#nonNullableFinalTopLevelFieldWithInitializer2.==(null) ?{core::int} self::_#nonNullableFinalTopLevelFieldWithInitializer2 = #t33 : throw new _in::LateInitializationErrorImpl::•("Field 'nonNullableFinalTopLevelFieldWithInitializer2' has been assigned during initialization.") : #t32{core::int};
static get nullableFinalTopLevelFieldWithInitializer2Init() → core::int
return let final core::int? #t36 = self::_#nullableFinalTopLevelFieldWithInitializer2Init in #t36.==(null) ?{core::int} self::_#nullableFinalTopLevelFieldWithInitializer2Init = 0 : #t36{core::int};
static set nullableFinalTopLevelFieldWithInitializer2Init(core::int #t37) → void
static get nullableFinalTopLevelFieldWithInitializer2Init() → core::int {
if(!self::_#nullableFinalTopLevelFieldWithInitializer2Init#isSet) {
self::_#nullableFinalTopLevelFieldWithInitializer2Init = 0;
self::_#nullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t36 = self::_#nullableFinalTopLevelFieldWithInitializer2Init in #t36{core::int};
}
static set nullableFinalTopLevelFieldWithInitializer2Init(core::int #t37) → void {
self::_#nullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
self::_#nullableFinalTopLevelFieldWithInitializer2Init = #t37;
}
static get nullableFinalTopLevelFieldWithInitializer2() → core::int? {
if(!self::_#nullableFinalTopLevelFieldWithInitializer2#isSet) {
final core::int? #t38 = (let final core::int #t39 = self::nullableFinalTopLevelFieldWithInitializer2Init in let final core::int #t40 = self::nullableFinalTopLevelFieldWithInitializer2Init = #t39.{core::num::+}(1) in #t39).{core::num::==}(0) ?{core::int} self::nullableFinalTopLevelFieldWithInitializer2!.{core::num::+}(1) : 32;

View file

@ -9,26 +9,39 @@ class Class extends core::Object {
field core::int nonNullableInstanceFieldWithInitializer = self::init<core::int>(55);
field core::int? nullableInstanceFieldWithInitializer = self::init<core::int?>(17);
static field core::int? _#nonNullableStaticFieldWithInitializer1 = null;
static field core::bool _#nonNullableStaticFieldWithInitializer1#isSet = false;
static field core::int? _#nullableStaticFieldWithInitializer1 = null;
static field core::bool _#nullableStaticFieldWithInitializer1#isSet = false;
static field core::int? _#nonNullableStaticFieldWithInitializer2 = null;
static field core::bool _#nonNullableStaticFieldWithInitializer2#isSet = false;
static field core::int? _#nullableStaticFieldWithInitializer2 = null;
static field core::bool _#nullableStaticFieldWithInitializer2#isSet = false;
static field core::int? _#nonNullableStaticFinalFieldWithInitializer1 = null;
static field core::bool _#nonNullableStaticFinalFieldWithInitializer1#isSet = false;
static field core::int? _#nullableStaticFinalFieldWithInitializer1 = null;
static field core::bool _#nullableStaticFinalFieldWithInitializer1#isSet = false;
static field core::int? _#nonNullableStaticFinalFieldWithInitializer2Init = null;
static field core::bool _#nonNullableStaticFinalFieldWithInitializer2Init#isSet = false;
static field core::int? _#nonNullableStaticFinalFieldWithInitializer2 = null;
static field core::bool _#nonNullableStaticFinalFieldWithInitializer2#isSet = false;
static field core::int? _#nullableStaticFinalFieldWithInitializer2Init = null;
static field core::bool _#nullableStaticFinalFieldWithInitializer2Init#isSet = false;
static field core::int? _#nullableStaticFinalFieldWithInitializer2 = null;
static field core::bool _#nullableStaticFinalFieldWithInitializer2#isSet = false;
synthetic constructor •() → self::Class
: super core::Object::•()
;
static get nonNullableStaticFieldWithInitializer1() → core::int
return let final core::int? #t1 = self::Class::_#nonNullableStaticFieldWithInitializer1 in #t1.==(null) ?{core::int} self::Class::_#nonNullableStaticFieldWithInitializer1 = self::init<core::int>(55) : #t1{core::int};
static set nonNullableStaticFieldWithInitializer1(core::int #t2) → void
static get nonNullableStaticFieldWithInitializer1() → core::int {
if(!self::Class::_#nonNullableStaticFieldWithInitializer1#isSet) {
self::Class::_#nonNullableStaticFieldWithInitializer1 = self::init<core::int>(55);
self::Class::_#nonNullableStaticFieldWithInitializer1#isSet = true;
}
return let final core::int? #t1 = self::Class::_#nonNullableStaticFieldWithInitializer1 in #t1{core::int};
}
static set nonNullableStaticFieldWithInitializer1(core::int #t2) → void {
self::Class::_#nonNullableStaticFieldWithInitializer1#isSet = true;
self::Class::_#nonNullableStaticFieldWithInitializer1 = #t2;
}
static get nullableStaticFieldWithInitializer1() → core::int? {
if(!self::Class::_#nullableStaticFieldWithInitializer1#isSet) {
self::Class::_#nullableStaticFieldWithInitializer1 = self::init<core::int?>(17);
@ -40,10 +53,17 @@ class Class extends core::Object {
self::Class::_#nullableStaticFieldWithInitializer1#isSet = true;
self::Class::_#nullableStaticFieldWithInitializer1 = #t3;
}
static get nonNullableStaticFieldWithInitializer2() → core::int
return let final core::int? #t4 = self::Class::_#nonNullableStaticFieldWithInitializer2 in #t4.==(null) ?{core::int} self::Class::_#nonNullableStaticFieldWithInitializer2 = self::init<core::int>(55) : #t4{core::int};
static set nonNullableStaticFieldWithInitializer2(core::int #t5) → void
static get nonNullableStaticFieldWithInitializer2() → core::int {
if(!self::Class::_#nonNullableStaticFieldWithInitializer2#isSet) {
self::Class::_#nonNullableStaticFieldWithInitializer2 = self::init<core::int>(55);
self::Class::_#nonNullableStaticFieldWithInitializer2#isSet = true;
}
return let final core::int? #t4 = self::Class::_#nonNullableStaticFieldWithInitializer2 in #t4{core::int};
}
static set nonNullableStaticFieldWithInitializer2(core::int #t5) → void {
self::Class::_#nonNullableStaticFieldWithInitializer2#isSet = true;
self::Class::_#nonNullableStaticFieldWithInitializer2 = #t5;
}
static get nullableStaticFieldWithInitializer2() → core::int? {
if(!self::Class::_#nullableStaticFieldWithInitializer2#isSet) {
self::Class::_#nullableStaticFieldWithInitializer2 = self::init<core::int?>(17);
@ -67,16 +87,30 @@ class Class extends core::Object {
}
return self::Class::_#nullableStaticFinalFieldWithInitializer1;
}
static get nonNullableStaticFinalFieldWithInitializer2Init() → core::int
return let final core::int? #t10 = self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init in #t10.==(null) ?{core::int} self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init = 0 : #t10{core::int};
static set nonNullableStaticFinalFieldWithInitializer2Init(core::int #t11) → void
static get nonNullableStaticFinalFieldWithInitializer2Init() → core::int {
if(!self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init#isSet) {
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init = 0;
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t10 = self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init in #t10{core::int};
}
static set nonNullableStaticFinalFieldWithInitializer2Init(core::int #t11) → void {
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init#isSet = true;
self::Class::_#nonNullableStaticFinalFieldWithInitializer2Init = #t11;
}
static get nonNullableStaticFinalFieldWithInitializer2() → core::int
return let final core::int? #t12 = self::Class::_#nonNullableStaticFinalFieldWithInitializer2 in #t12.==(null) ?{core::int} let final core::int #t13 = (let final core::int #t14 = self::Class::nonNullableStaticFinalFieldWithInitializer2Init in let final core::int #t15 = self::Class::nonNullableStaticFinalFieldWithInitializer2Init = #t14.{core::num::+}(1) in #t14).{core::num::==}(0) ?{core::int} self::Class::nonNullableStaticFinalFieldWithInitializer2.{core::num::+}(1) : 87 in self::Class::_#nonNullableStaticFinalFieldWithInitializer2.==(null) ?{core::int} self::Class::_#nonNullableStaticFinalFieldWithInitializer2 = #t13 : throw new _in::LateInitializationErrorImpl::•("Field 'nonNullableStaticFinalFieldWithInitializer2' has been assigned during initialization.") : #t12{core::int};
static get nullableStaticFinalFieldWithInitializer2Init() → core::int
return let final core::int? #t16 = self::Class::_#nullableStaticFinalFieldWithInitializer2Init in #t16.==(null) ?{core::int} self::Class::_#nullableStaticFinalFieldWithInitializer2Init = 0 : #t16{core::int};
static set nullableStaticFinalFieldWithInitializer2Init(core::int #t17) → void
static get nullableStaticFinalFieldWithInitializer2Init() → core::int {
if(!self::Class::_#nullableStaticFinalFieldWithInitializer2Init#isSet) {
self::Class::_#nullableStaticFinalFieldWithInitializer2Init = 0;
self::Class::_#nullableStaticFinalFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t16 = self::Class::_#nullableStaticFinalFieldWithInitializer2Init in #t16{core::int};
}
static set nullableStaticFinalFieldWithInitializer2Init(core::int #t17) → void {
self::Class::_#nullableStaticFinalFieldWithInitializer2Init#isSet = true;
self::Class::_#nullableStaticFinalFieldWithInitializer2Init = #t17;
}
static get nullableStaticFinalFieldWithInitializer2() → core::int? {
if(!self::Class::_#nullableStaticFinalFieldWithInitializer2#isSet) {
final core::int? #t18 = (let final core::int #t19 = self::Class::nullableStaticFinalFieldWithInitializer2Init in let final core::int #t20 = self::Class::nullableStaticFinalFieldWithInitializer2Init = #t19.{core::num::+}(1) in #t19).{core::num::==}(0) ?{core::int} self::Class::nullableStaticFinalFieldWithInitializer2!.{core::num::+}(1) : 32;
@ -92,27 +126,40 @@ static field dynamic lastInit;
static const field core::int constTopLevelField = #C2;
static field core::int? topLevelFieldWithoutInitializer;
static field core::int? _#nonNullableTopLevelFieldWithInitializer1 = null;
static field core::bool _#nonNullableTopLevelFieldWithInitializer1#isSet = false;
static field core::int? _#nullableTopLevelFieldWithInitializer = null;
static field core::bool _#nullableTopLevelFieldWithInitializer#isSet = false;
static field core::int? _#nonNullableTopLevelFieldWithInitializer2 = null;
static field core::bool _#nonNullableTopLevelFieldWithInitializer2#isSet = false;
static field core::int? _#nullableTopLevelFieldWithInitializer2 = null;
static field core::bool _#nullableTopLevelFieldWithInitializer2#isSet = false;
static field core::int? _#nonNullableFinalTopLevelFieldWithInitializer1 = null;
static field core::bool _#nonNullableFinalTopLevelFieldWithInitializer1#isSet = false;
static field core::int? _#nullableFinalTopLevelFieldWithInitializer1 = null;
static field core::bool _#nullableFinalTopLevelFieldWithInitializer1#isSet = false;
static field core::int? _#nonNullableFinalTopLevelFieldWithInitializer2Init = null;
static field core::bool _#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet = false;
static field core::int? _#nonNullableFinalTopLevelFieldWithInitializer2 = null;
static field core::bool _#nonNullableFinalTopLevelFieldWithInitializer2#isSet = false;
static field core::int? _#nullableFinalTopLevelFieldWithInitializer2Init = null;
static field core::bool _#nullableFinalTopLevelFieldWithInitializer2Init#isSet = false;
static field core::int? _#nullableFinalTopLevelFieldWithInitializer2 = null;
static field core::bool _#nullableFinalTopLevelFieldWithInitializer2#isSet = false;
static method init<T extends core::Object? = dynamic>(self::init::T% value) → self::init::T% {
self::lastInit = value;
return value;
}
static get nonNullableTopLevelFieldWithInitializer1() → core::int
return let final core::int? #t21 = self::_#nonNullableTopLevelFieldWithInitializer1 in #t21.==(null) ?{core::int} self::_#nonNullableTopLevelFieldWithInitializer1 = self::init<core::int>(42) : #t21{core::int};
static set nonNullableTopLevelFieldWithInitializer1(core::int #t22) → void
static get nonNullableTopLevelFieldWithInitializer1() → core::int {
if(!self::_#nonNullableTopLevelFieldWithInitializer1#isSet) {
self::_#nonNullableTopLevelFieldWithInitializer1 = self::init<core::int>(42);
self::_#nonNullableTopLevelFieldWithInitializer1#isSet = true;
}
return let final core::int? #t21 = self::_#nonNullableTopLevelFieldWithInitializer1 in #t21{core::int};
}
static set nonNullableTopLevelFieldWithInitializer1(core::int #t22) → void {
self::_#nonNullableTopLevelFieldWithInitializer1#isSet = true;
self::_#nonNullableTopLevelFieldWithInitializer1 = #t22;
}
static get nullableTopLevelFieldWithInitializer() → core::int? {
if(!self::_#nullableTopLevelFieldWithInitializer#isSet) {
self::_#nullableTopLevelFieldWithInitializer = self::init<core::int?>(123);
@ -124,10 +171,17 @@ static set nullableTopLevelFieldWithInitializer(core::int? #t23) → void {
self::_#nullableTopLevelFieldWithInitializer#isSet = true;
self::_#nullableTopLevelFieldWithInitializer = #t23;
}
static get nonNullableTopLevelFieldWithInitializer2() → core::int
return let final core::int? #t24 = self::_#nonNullableTopLevelFieldWithInitializer2 in #t24.==(null) ?{core::int} self::_#nonNullableTopLevelFieldWithInitializer2 = self::init<core::int>(42) : #t24{core::int};
static set nonNullableTopLevelFieldWithInitializer2(core::int #t25) → void
static get nonNullableTopLevelFieldWithInitializer2() → core::int {
if(!self::_#nonNullableTopLevelFieldWithInitializer2#isSet) {
self::_#nonNullableTopLevelFieldWithInitializer2 = self::init<core::int>(42);
self::_#nonNullableTopLevelFieldWithInitializer2#isSet = true;
}
return let final core::int? #t24 = self::_#nonNullableTopLevelFieldWithInitializer2 in #t24{core::int};
}
static set nonNullableTopLevelFieldWithInitializer2(core::int #t25) → void {
self::_#nonNullableTopLevelFieldWithInitializer2#isSet = true;
self::_#nonNullableTopLevelFieldWithInitializer2 = #t25;
}
static get nullableTopLevelFieldWithInitializer2() → core::int? {
if(!self::_#nullableTopLevelFieldWithInitializer2#isSet) {
self::_#nullableTopLevelFieldWithInitializer2 = self::init<core::int?>(123);
@ -151,16 +205,30 @@ static get nullableFinalTopLevelFieldWithInitializer1() → core::int? {
}
return self::_#nullableFinalTopLevelFieldWithInitializer1;
}
static get nonNullableFinalTopLevelFieldWithInitializer2Init() → core::int
return let final core::int? #t30 = self::_#nonNullableFinalTopLevelFieldWithInitializer2Init in #t30.==(null) ?{core::int} self::_#nonNullableFinalTopLevelFieldWithInitializer2Init = 0 : #t30{core::int};
static set nonNullableFinalTopLevelFieldWithInitializer2Init(core::int #t31) → void
static get nonNullableFinalTopLevelFieldWithInitializer2Init() → core::int {
if(!self::_#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet) {
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init = 0;
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t30 = self::_#nonNullableFinalTopLevelFieldWithInitializer2Init in #t30{core::int};
}
static set nonNullableFinalTopLevelFieldWithInitializer2Init(core::int #t31) → void {
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
self::_#nonNullableFinalTopLevelFieldWithInitializer2Init = #t31;
}
static get nonNullableFinalTopLevelFieldWithInitializer2() → core::int
return let final core::int? #t32 = self::_#nonNullableFinalTopLevelFieldWithInitializer2 in #t32.==(null) ?{core::int} let final core::int #t33 = (let final core::int #t34 = self::nonNullableFinalTopLevelFieldWithInitializer2Init in let final core::int #t35 = self::nonNullableFinalTopLevelFieldWithInitializer2Init = #t34.{core::num::+}(1) in #t34).{core::num::==}(0) ?{core::int} self::nonNullableFinalTopLevelFieldWithInitializer2.{core::num::+}(1) : 87 in self::_#nonNullableFinalTopLevelFieldWithInitializer2.==(null) ?{core::int} self::_#nonNullableFinalTopLevelFieldWithInitializer2 = #t33 : throw new _in::LateInitializationErrorImpl::•("Field 'nonNullableFinalTopLevelFieldWithInitializer2' has been assigned during initialization.") : #t32{core::int};
static get nullableFinalTopLevelFieldWithInitializer2Init() → core::int
return let final core::int? #t36 = self::_#nullableFinalTopLevelFieldWithInitializer2Init in #t36.==(null) ?{core::int} self::_#nullableFinalTopLevelFieldWithInitializer2Init = 0 : #t36{core::int};
static set nullableFinalTopLevelFieldWithInitializer2Init(core::int #t37) → void
static get nullableFinalTopLevelFieldWithInitializer2Init() → core::int {
if(!self::_#nullableFinalTopLevelFieldWithInitializer2Init#isSet) {
self::_#nullableFinalTopLevelFieldWithInitializer2Init = 0;
self::_#nullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
}
return let final core::int? #t36 = self::_#nullableFinalTopLevelFieldWithInitializer2Init in #t36{core::int};
}
static set nullableFinalTopLevelFieldWithInitializer2Init(core::int #t37) → void {
self::_#nullableFinalTopLevelFieldWithInitializer2Init#isSet = true;
self::_#nullableFinalTopLevelFieldWithInitializer2Init = #t37;
}
static get nullableFinalTopLevelFieldWithInitializer2() → core::int? {
if(!self::_#nullableFinalTopLevelFieldWithInitializer2#isSet) {
final core::int? #t38 = (let final core::int #t39 = self::nullableFinalTopLevelFieldWithInitializer2Init in let final core::int #t40 = self::nullableFinalTopLevelFieldWithInitializer2Init = #t39.{core::num::+}(1) in #t39).{core::num::==}(0) ?{core::int} self::nullableFinalTopLevelFieldWithInitializer2!.{core::num::+}(1) : 32;

View file

@ -171,6 +171,7 @@ inference_new/invalid_assignment_during_toplevel_inference: TypeCheckError
instantiate_to_bound/non_simple_class_parametrized_typedef_cycle: RuntimeError # Expected
instantiate_to_bound/non_simple_generic_function_in_bound_regress: RuntimeError # Expected
late_lowering/covariant_late_field: TypeCheckError
late_lowering/non_nullable_from_opt_out: RuntimeError # Test is inherently mixed mode
nnbd/covariant_late_field: TypeCheckError
nnbd/issue41180: RuntimeError # Strong mode runtime checking fails due to mixed strong mode.
nnbd/issue42546: TypeCheckError

View file

@ -169,6 +169,7 @@ inference_new/invalid_assignment_during_toplevel_inference: TypeCheckError
instantiate_to_bound/non_simple_class_parametrized_typedef_cycle: RuntimeError
instantiate_to_bound/non_simple_generic_function_in_bound_regress: RuntimeError
late_lowering/covariant_late_field: TypeCheckError
late_lowering/non_nullable_from_opt_out: RuntimeError # Test is inherently mixed mode
nnbd/covariant_late_field: TypeCheckError
nnbd/issue41180: RuntimeError
nnbd/issue42546: TypeCheckError