Version 2.11.0-153.0.dev
Merge commit '7252a146a2f6ac28fa76e2c02d5deebbc1b26ca2' into 'dev'
diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
index 12e1c33..18686f8 100644
--- a/.dart_tool/package_config.json
+++ b/.dart_tool/package_config.json
@@ -11,7 +11,7 @@
"constraint, update this by running tools/generate_package_config.dart."
],
"configVersion": 2,
- "generated": "2020-08-18T15:38:52.410101",
+ "generated": "2020-09-18T09:56:27.880444",
"generator": "tools/generate_package_config.dart",
"packages": [
{
@@ -184,7 +184,7 @@
"name": "dart2js_info",
"rootUri": "../third_party/pkg/dart2js_info",
"packageUri": "lib/",
- "languageVersion": "2.0"
+ "languageVersion": "2.3"
},
{
"name": "dart2js_tools",
@@ -207,8 +207,7 @@
{
"name": "dart_style",
"rootUri": "../third_party/pkg_tested/dart_style",
- "packageUri": "lib/",
- "languageVersion": "2.7"
+ "packageUri": "lib/"
},
{
"name": "dartdev",
@@ -348,8 +347,7 @@
{
"name": "js_runtime",
"rootUri": "../sdk/lib/_internal/js_runtime",
- "packageUri": "lib/",
- "languageVersion": "2.10"
+ "packageUri": "lib/"
},
{
"name": "json_rpc_2",
@@ -484,8 +482,7 @@
{
"name": "pub",
"rootUri": "../third_party/pkg/pub",
- "packageUri": "lib/",
- "languageVersion": "2.3"
+ "packageUri": "lib/"
},
{
"name": "pub_semver",
@@ -508,8 +505,7 @@
{
"name": "sdk_library_metadata",
"rootUri": "../sdk/lib/_internal/sdk_library_metadata",
- "packageUri": "lib/",
- "languageVersion": "2.10"
+ "packageUri": "lib/"
},
{
"name": "shelf",
@@ -752,4 +748,4 @@
"languageVersion": "2.4"
}
]
-}
+}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98626d0..643c771 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,23 @@
-## 2.10.0
+## 2.11.0
+
+### Core libraries
+
+### Dart VM
+
+### Dart2JS
+
+### Tools
+
+#### Linter
+
+Updated the Linter to `0.1.119`, which includes:
+
+* Fixed `close_sinks` to handle `this`-prefixed property accesses.
+* New lint: `unnecessary_null_checks`.
+* Fixed `unawaited_futures` to handle `Future` subtypes.
+* New lint: `avoid_type_to_string`.
+
+## 2.10.0 - 2020-09-28
### Core libraries
@@ -8,7 +27,7 @@
to cancel outgoing HTTP requests and stop following IO operations.
* A validation check is added to `path` of class `Cookie`. Having characters
ranging from 0x00 to 0x1f and 0x3b (";") will lead to a `FormatException`.
-* The `HttpClient` and `HttpServer` clasess now have a 1 MiB limit for the
+* The `HttpClient` and `HttpServer` classes now have a 1 MiB limit for the
total size of the HTTP headers when parsing a request or response, instead
of the former 8 KiB limit for each header name and value. This limit cannot
be configured at this time.
@@ -54,12 +73,8 @@
#### Linter
-Updated the Linter to `0.1.119`, which includes:
+Updated the Linter to `0.1.118`, which includes:
-* Fixed `close_sinks` to handle `this`-prefixed property accesses.
-* New lint: `unnecessary_null_checks`.
-* Fixed `unawaited_futures` to handle `Future` subtypes.
-* New lint: `avoid_type_to_string`.
* New lint: `unnecessary_nullable_for_final_variable_declarations`.
* Fixed NPE in `prefer_asserts_in_initializer_lists`.
* Fixed range error in `unnecessary_string_escapes`.
diff --git a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
index f29bfb4..ee6204e 100644
--- a/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
@@ -8,7 +8,7 @@
/// The current version of the Dart language (or, for non-stable releases, the
/// version of the language currently in the process of being developed).
-const _currentVersion = '2.10.0';
+const _currentVersion = '2.11.0';
/// A map containing information about all known experimental flags.
final _knownFeatures = <String, ExperimentalFeature>{
diff --git a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
index b9ab190..01c5fd8 100644
--- a/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
+++ b/pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
@@ -24,17 +24,17 @@
}
const Version enableAlternativeInvalidationStrategyVersion =
- const Version(2, 10);
+ const Version(2, 11);
const Version enableConstantUpdate2018Version = const Version(2, 4);
const Version enableControlFlowCollectionsVersion = const Version(2, 0);
const Version enableExtensionMethodsVersion = const Version(2, 6);
-const Version enableNonNullableVersion = const Version(2, 10);
-const Version enableNonfunctionTypeAliasesVersion = const Version(2, 10);
+const Version enableNonNullableVersion = const Version(2, 11);
+const Version enableNonfunctionTypeAliasesVersion = const Version(2, 11);
const Version enableSetLiteralsVersion = const Version(2, 0);
const Version enableSpreadCollectionsVersion = const Version(2, 0);
-const Version enableTripleShiftVersion = const Version(2, 10);
-const Version enableValueClassVersion = const Version(2, 10);
-const Version enableVarianceVersion = const Version(2, 10);
+const Version enableTripleShiftVersion = const Version(2, 11);
+const Version enableValueClassVersion = const Version(2, 11);
+const Version enableVarianceVersion = const Version(2, 11);
ExperimentalFlag parseExperimentalFlag(String flag) {
switch (flag) {
@@ -93,31 +93,31 @@
};
const Map<ExperimentalFlag, Version> experimentEnabledVersion = {
- ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 10),
+ ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 11),
ExperimentalFlag.constantUpdate2018: const Version(2, 4),
ExperimentalFlag.controlFlowCollections: const Version(2, 0),
ExperimentalFlag.extensionMethods: const Version(2, 6),
- ExperimentalFlag.nonNullable: const Version(2, 10),
- ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 10),
+ ExperimentalFlag.nonNullable: const Version(2, 11),
+ ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 11),
ExperimentalFlag.setLiterals: const Version(2, 0),
ExperimentalFlag.spreadCollections: const Version(2, 0),
- ExperimentalFlag.tripleShift: const Version(2, 10),
- ExperimentalFlag.valueClass: const Version(2, 10),
- ExperimentalFlag.variance: const Version(2, 10),
+ ExperimentalFlag.tripleShift: const Version(2, 11),
+ ExperimentalFlag.valueClass: const Version(2, 11),
+ ExperimentalFlag.variance: const Version(2, 11),
};
const Map<ExperimentalFlag, Version> experimentReleasedVersion = {
- ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 10),
+ ExperimentalFlag.alternativeInvalidationStrategy: const Version(2, 11),
ExperimentalFlag.constantUpdate2018: const Version(2, 4),
ExperimentalFlag.controlFlowCollections: const Version(2, 0),
ExperimentalFlag.extensionMethods: const Version(2, 6),
ExperimentalFlag.nonNullable: const Version(2, 10),
- ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 10),
+ ExperimentalFlag.nonfunctionTypeAliases: const Version(2, 11),
ExperimentalFlag.setLiterals: const Version(2, 0),
ExperimentalFlag.spreadCollections: const Version(2, 0),
- ExperimentalFlag.tripleShift: const Version(2, 10),
- ExperimentalFlag.valueClass: const Version(2, 10),
- ExperimentalFlag.variance: const Version(2, 10),
+ ExperimentalFlag.tripleShift: const Version(2, 11),
+ ExperimentalFlag.valueClass: const Version(2, 11),
+ ExperimentalFlag.variance: const Version(2, 11),
};
const AllowedExperimentalFlags defaultAllowedExperimentalFlags =
diff --git a/pkg/front_end/lib/src/fasta/builder/field_builder.dart b/pkg/front_end/lib/src/fasta/builder/field_builder.dart
index 9f0a936..928ef74 100644
--- a/pkg/front_end/lib/src/fasta/builder/field_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/field_builder.dart
@@ -10,6 +10,8 @@
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 @@
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 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
} else {
_fieldEncoding = new LateFieldWithInitializerEncoding(
name,
@@ -154,7 +160,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
}
} else {
if (isFinal) {
@@ -167,7 +174,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
} else {
_fieldEncoding = new LateFieldWithoutInitializerEncoding(
name,
@@ -178,7 +186,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
}
}
} else if (libraryBuilder.isNonNullableByDefault &&
@@ -196,7 +205,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
} else {
_fieldEncoding = new LateFieldWithInitializerEncoding(
name,
@@ -207,7 +217,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
}
} else {
assert(lateIsSetReferenceFrom == null);
@@ -714,11 +725,21 @@
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 @@
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 @@
createVariableWrite: (Expression value) =>
_createFieldSet(_field, value),
createIsSetWrite: (Expression value) =>
- _createFieldSet(_lateIsSetField, value));
+ _createFieldSet(_lateIsSetField, value),
+ useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@@ -1060,7 +1085,8 @@
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 @@
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
- bool isCovariant)
+ bool isCovariant,
+ bool forceUseIsSetField)
: super(
name,
fileUri,
@@ -1085,7 +1112,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
}
class LateFieldWithInitializerEncoding extends AbstractLateFieldEncoding
@@ -1099,7 +1127,8 @@
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
- bool isCovariant)
+ bool isCovariant,
+ bool forceUseIsSetField)
: super(
name,
fileUri,
@@ -1109,7 +1138,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
@override
Statement _createGetterBody(
@@ -1122,7 +1152,8 @@
_createFieldSet(_field, value),
createIsSetRead: () => _createFieldGet(_lateIsSetField),
createIsSetWrite: (Expression value) =>
- _createFieldSet(_lateIsSetField, value));
+ _createFieldSet(_lateIsSetField, value),
+ useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@@ -1137,7 +1168,8 @@
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
- bool isCovariant)
+ bool isCovariant,
+ bool forceUseIsSetField)
: super(
name,
fileUri,
@@ -1147,7 +1179,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
@override
Statement _createSetterBody(
@@ -1161,7 +1194,8 @@
_createFieldSet(_field, value),
createIsSetRead: () => _createFieldGet(_lateIsSetField),
createIsSetWrite: (Expression value) =>
- _createFieldSet(_lateIsSetField, value));
+ _createFieldSet(_lateIsSetField, value),
+ useIsSetField: _forceUseIsSetField || type.isPotentiallyNullable);
}
}
@@ -1175,7 +1209,8 @@
Field lateIsSetReferenceFrom,
Procedure getterReferenceFrom,
Procedure setterReferenceFrom,
- bool isCovariant)
+ bool isCovariant,
+ bool forceUseIsSetField)
: super(
name,
fileUri,
@@ -1185,7 +1220,8 @@
lateIsSetReferenceFrom,
getterReferenceFrom,
setterReferenceFrom,
- isCovariant);
+ isCovariant,
+ forceUseIsSetField);
@override
Statement _createGetterBody(
CoreTypes coreTypes, String name, Expression initializer) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
index 659754b..6f9a38e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -503,21 +503,8 @@
@override
Expression buildIfNullAssignment(Expression value, DartType type, int offset,
{bool voidContext = false}) {
- VariableDeclaration variable =
- _helper.forest.createVariableDeclarationForValue(receiver);
- PropertyGet read = _forest.createPropertyGet(
- fileOffset,
- _helper.createVariableGet(variable, receiver.fileOffset,
- forNullGuardedAccess: true),
- name);
- PropertySet write = _helper.forest.createPropertySet(
- fileOffset,
- _helper.createVariableGet(variable, receiver.fileOffset,
- forNullGuardedAccess: true),
- name,
- value,
- forEffect: voidContext);
- return new IfNullPropertySet(variable, read, write, forEffect: voidContext)
+ return new IfNullPropertySet(receiver, name, value,
+ forEffect: voidContext, readOffset: fileOffset, writeOffset: fileOffset)
..fileOffset = offset;
}
@@ -2037,15 +2024,10 @@
..fileOffset = offset)
..fileOffset = fileOffset;
} else {
- VariableDeclaration variable =
- _helper.forest.createVariableDeclarationForValue(receiver);
- Expression read =
- _createRead(_helper.createVariableGet(variable, receiver.fileOffset));
- Expression write = _createWrite(fileOffset,
- _helper.createVariableGet(variable, receiver.fileOffset), value,
- forEffect: voidContext, readOnlyReceiver: true);
- return new IfNullPropertySet(variable, read, write,
- forEffect: voidContext)
+ return new IfNullPropertySet(receiver, targetName, value,
+ forEffect: voidContext,
+ readOffset: fileOffset,
+ writeOffset: fileOffset)
..fileOffset = offset;
}
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
index e606538..31d4186 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -15,6 +15,7 @@
InstrumentationValueForMember,
InstrumentationValueForType,
InstrumentationValueForTypeArgs;
+import '../../base/nnbd_mode.dart';
import '../fasta_codes.dart';
import '../names.dart';
import '../problems.dart' show unhandled;
@@ -2679,29 +2680,66 @@
ExpressionInferenceResult visitIfNullPropertySet(
IfNullPropertySet node, DartType typeContext) {
- Link<NullAwareGuard> nullAwareGuards =
- inferrer.inferSyntheticVariableNullAware(node.variable);
- ExpressionInferenceResult readResult = inferrer.inferExpression(
- node.read, const UnknownType(), true,
- isVoidAllowed: true);
+ ExpressionInferenceResult receiverResult = inferrer.inferExpression(
+ node.receiver, const UnknownType(), true,
+ isVoidAllowed: false);
+
+ Link<NullAwareGuard> nullAwareGuards;
+ Expression receiver;
+ DartType receiverType;
+ if (inferrer.isNonNullableByDefault) {
+ nullAwareGuards = receiverResult.nullAwareGuards;
+ receiver = receiverResult.nullAwareAction;
+ receiverType = receiverResult.nullAwareActionType;
+ } else {
+ receiver = receiverResult.expression;
+ receiverType = receiverResult.inferredType;
+ }
+
+ VariableDeclaration receiverVariable =
+ createVariable(receiver, receiverType);
+ inferrer.instrumentation?.record(
+ inferrer.uriForInstrumentation,
+ receiverVariable.fileOffset,
+ 'type',
+ new InstrumentationValueForType(receiverType));
+ Expression readReceiver = createVariableGet(receiverVariable);
+ Expression writeReceiver = createVariableGet(receiverVariable);
+
+ ExpressionInferenceResult readResult = _computePropertyGet(node.readOffset,
+ readReceiver, receiverType, node.propertyName, const UnknownType(),
+ isThisReceiver: node.receiver is ThisExpression);
+
reportNonNullableInNullAwareWarningIfNeeded(
- readResult.inferredType, "??=", node.read.fileOffset);
+ readResult.inferredType, "??=", node.readOffset);
Expression read = readResult.expression;
DartType readType = readResult.inferredType;
+ ObjectAccessTarget writeTarget = inferrer.findInterfaceMember(
+ receiverType, node.propertyName, receiver.fileOffset,
+ setter: true, instrumented: true, includeExtensionMethods: true);
+ DartType writeContext = inferrer.getSetterType(writeTarget, receiverType);
+
inferrer.flowAnalysis.ifNullExpression_rightBegin(read, readType);
- ExpressionInferenceResult writeResult = inferrer
- .inferExpression(node.write, typeContext, true, isVoidAllowed: true);
+ ExpressionInferenceResult rhsResult = inferrer
+ .inferExpression(node.rhs, writeContext, true, isVoidAllowed: true);
inferrer.flowAnalysis.ifNullExpression_end();
+ Expression rhs = inferrer.ensureAssignableResult(writeContext, rhsResult);
+
+ DartType writeType = rhsResult.inferredType;
+ Expression write = _computePropertySet(node.writeOffset, writeReceiver,
+ receiverType, node.propertyName, writeTarget, rhs,
+ forEffect: node.forEffect, valueType: writeType);
+
Member equalsMember = inferrer
.findInterfaceMember(readType, equalsName, node.fileOffset)
.member;
DartType nonNullableReadType = inferrer.computeNonNullable(readType);
DartType inferredType = inferrer.typeSchemaEnvironment
- .getStandardUpperBound(nonNullableReadType, writeResult.inferredType,
- inferrer.library.library);
+ .getStandardUpperBound(
+ nonNullableReadType, writeType, inferrer.library.library);
Expression replacement;
if (node.forEffect) {
@@ -2711,14 +2749,11 @@
//
MethodInvocation equalsNull =
createEqualsNull(node.fileOffset, read, equalsMember);
- ConditionalExpression conditional = new ConditionalExpression(
- equalsNull,
- writeResult.expression,
- new NullLiteral()..fileOffset = node.fileOffset,
- inferredType)
+ ConditionalExpression conditional = new ConditionalExpression(equalsNull,
+ write, new NullLiteral()..fileOffset = node.fileOffset, inferredType)
..fileOffset = node.fileOffset;
replacement =
- new Let(node.variable, conditional..fileOffset = node.fileOffset)
+ new Let(receiverVariable, conditional..fileOffset = node.fileOffset)
..fileOffset = node.fileOffset;
} else {
// Encode `o.a ??= b` as:
@@ -2734,10 +2769,11 @@
variableGet.promotedType = nonNullableReadType;
}
ConditionalExpression conditional = new ConditionalExpression(
- equalsNull, writeResult.expression, variableGet, inferredType)
+ equalsNull, write, variableGet, inferredType)
..fileOffset = node.fileOffset;
- replacement = new Let(node.variable, createLet(readVariable, conditional))
- ..fileOffset = node.fileOffset;
+ replacement =
+ new Let(receiverVariable, createLet(readVariable, conditional))
+ ..fileOffset = node.fileOffset;
}
return inferrer.createNullAwareExpressionInferenceResult(
@@ -5634,7 +5670,11 @@
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 +5716,8 @@
node.type,
'Local',
createVariableRead: createVariableRead,
- createIsSetRead: createIsSetRead)
+ createIsSetRead: createIsSetRead,
+ useIsSetField: isSetVariable != null)
: late_lowering.createGetterWithInitializer(
inferrer.coreTypes,
fileOffset,
@@ -5686,7 +5727,8 @@
createVariableRead: createVariableRead,
createVariableWrite: createVariableWrite,
createIsSetRead: createIsSetRead,
- createIsSetWrite: createIsSetWrite),
+ createIsSetWrite: createIsSetWrite,
+ useIsSetField: isSetVariable != null),
returnType: node.type))
..fileOffset = fileOffset;
getVariable.type =
@@ -5720,12 +5762,14 @@
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
diff --git a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
index a47d7a5..df79b09 100644
--- a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
@@ -1595,23 +1595,29 @@
/// let v1 = o in v1.a == null ? v1.a = b : null
///
class IfNullPropertySet extends InternalExpression {
- /// The synthetic variable whose initializer hold the receiver.
- VariableDeclaration variable;
+ /// The receiver used for the read/write operations.
+ Expression receiver;
- /// The expression that reads the property from [variable].
- Expression read;
+ /// Name of the property.
+ Name propertyName;
- /// The expression that writes the value to the property on [variable].
- Expression write;
+ /// The right-hand side of the binary operation.
+ Expression rhs;
/// If `true`, the expression is only need for effect and not for its value.
final bool forEffect;
- IfNullPropertySet(this.variable, this.read, this.write, {this.forEffect})
+ /// The file offset for the read operation.
+ final int readOffset;
+
+ /// The file offset for the write operation.
+ final int writeOffset;
+
+ IfNullPropertySet(this.receiver, this.propertyName, this.rhs,
+ {this.forEffect, this.readOffset, this.writeOffset})
: assert(forEffect != null) {
- variable?.parent = this;
- read?.parent = this;
- write?.parent = this;
+ receiver?.parent = this;
+ rhs?.parent = this;
}
@override
@@ -1625,24 +1631,19 @@
@override
void visitChildren(Visitor<dynamic> v) {
- variable?.accept(v);
- read?.accept(v);
- write?.accept(v);
+ receiver?.accept(v);
+ rhs?.accept(v);
}
@override
void transformChildren(Transformer v) {
- if (variable != null) {
- variable = variable.accept<TreeNode>(v);
- variable?.parent = this;
+ if (receiver != null) {
+ receiver = receiver.accept<TreeNode>(v);
+ receiver?.parent = this;
}
- if (read != null) {
- read = read.accept<TreeNode>(v);
- read?.parent = this;
- }
- if (write != null) {
- write = write.accept<TreeNode>(v);
- write?.parent = this;
+ if (rhs != null) {
+ rhs = rhs.accept<TreeNode>(v);
+ rhs?.parent = this;
}
}
@@ -1653,12 +1654,11 @@
@override
void toTextInternal(AstPrinter printer) {
- printer.write('let ');
- printer.writeVariableDeclaration(variable);
- printer.write(' in if-null ');
- printer.writeExpression(read);
- printer.write(' ?? ');
- printer.writeExpression(write);
+ printer.writeExpression(receiver);
+ printer.write('.');
+ printer.writeName(propertyName);
+ printer.write(' ??= ');
+ printer.writeExpression(rhs);
}
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart b/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart
index 9cfb1fc..6fc6f43 100644
--- a/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/late_lowering.dart
@@ -26,8 +26,10 @@
{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 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 @@
..fileOffset = fileOffset)
..fileOffset = fileOffset)
..fileOffset = fileOffset;
- if (type.isPotentiallyNullable) {
+ if (useIsSetField) {
// Generate:
//
// return _#isSet#field ? _#field : throw '...';
@@ -272,7 +276,9 @@
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 @@
createVariableWrite(new VariableGet(parameter)..fileOffset = fileOffset)
..fileOffset = fileOffset);
- if (type.isPotentiallyNullable) {
+ if (useIsSetField) {
// Generate:
//
// _#isSet#field = true;
@@ -321,7 +327,9 @@
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 @@
}
}
- if (type.isPotentiallyNullable) {
+ if (useIsSetField) {
// Generate:
//
// if (_#isSet#field) {
diff --git a/pkg/front_end/test/predicates/data/late.dart b/pkg/front_end/test/predicates/data/late.dart
index 0d28456..3218974 100644
--- a/pkg/front_end/test/predicates/data/late.dart
+++ b/pkg/front_end/test/predicates/data/late.dart
@@ -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 @@
/*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 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 @@
/*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 @@
/*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 @@
/*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;
diff --git a/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart b/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
index d449d21..c577233 100644
--- a/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
+++ b/pkg/front_end/test/text_representation/internal_ast_text_representation_test.dart
@@ -549,27 +549,17 @@
}
void _testIfNullPropertySet() {
- VariableDeclaration variable =
- new VariableDeclarationImpl.forValue(new IntLiteral(0));
testExpression(
new IfNullPropertySet(
- variable,
- new PropertyGet(new VariableGet(variable), new Name('foo')),
- new PropertySet(
- new VariableGet(variable), new Name('foo'), new IntLiteral(1)),
+ new IntLiteral(0), new Name('foo'), new IntLiteral(1),
forEffect: false),
- '''
-let final dynamic #0 = 0 in if-null #0.foo ?? #0.foo = 1''');
+ '0.foo ??= 1');
testExpression(
new IfNullPropertySet(
- variable,
- new PropertyGet(new VariableGet(variable), new Name('foo')),
- new PropertySet(
- new VariableGet(variable), new Name('foo'), new IntLiteral(1)),
+ new IntLiteral(0), new Name('foo'), new IntLiteral(1),
forEffect: true),
- '''
-let final dynamic #0 = 0 in if-null #0.foo ?? #0.foo = 1''');
+ '0.foo ??= 1');
}
void _testIfNullSet() {
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart
index 06d6032..39b30e6 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart
@@ -23,7 +23,7 @@
static void test(Test t) {
t. /*@target=Test.member*/ member = /*@ typeArgs=B* */ f();
- /*@ type=Test* */ t. /*@target=Test.member*/ /*@target=Test.member*/ member
+ /*@ type=Test* */ /*@target=Test.member*/ t. /*@target=Test.member*/ member
/*@target=A.==*/ ??= /*@ typeArgs=B* */ f();
/*@ type=Test* */ t. /*@target=Test.member*/ /*@target=Test.member*/ member
/*@target=B.+*/ += /*@ typeArgs=C* */ f();
@@ -38,8 +38,8 @@
var /*@ type=B* */ v1 =
t. /*@target=Test.member*/ member = /*@ typeArgs=B* */ f();
var /*@ type=B* */ v2 =
- /*@ type=Test* */ t
- . /*@target=Test.member*/ /*@target=Test.member*/ member
+ /*@ type=Test* */ /*@target=Test.member*/ t
+ . /*@target=Test.member*/ member
/*@target=A.==*/ ??= /*@ typeArgs=B* */ f();
var /*@ type=A* */ v3 =
/*@ type=Test* */ t
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart b/pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart
index 46fbc47..4422d57 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_upwards.dart
@@ -14,8 +14,8 @@
static void test(Test1 t) {
var /*@ type=int* */ v1 = t. /*@target=Test1.prop*/ prop = getInt();
- var /*@ type=int* */ v4 = /*@ type=Test1* */ t
- . /*@target=Test1.prop*/ /*@target=Test1.prop*/ prop
+ var /*@ type=int* */ v4 = /*@ type=Test1* */ /*@target=Test1.prop*/ t
+ . /*@target=Test1.prop*/ prop
/*@target=num.==*/ ??= getInt();
var /*@ type=int* */ v7 =
/*@ type=Test1* */ t. /*@target=Test1.prop*/ /*@target=Test1.prop*/ prop
@@ -35,14 +35,14 @@
var /*@ type=int* */ v1 = t. /*@target=Test2.prop*/ prop = getInt();
var /*@ type=num* */ v2 = t. /*@target=Test2.prop*/ prop = getNum();
var /*@ type=double* */ v3 = t. /*@target=Test2.prop*/ prop = getDouble();
- var /*@ type=num* */ v4 = /*@ type=Test2* */ t
- . /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
+ var /*@ type=num* */ v4 = /*@ type=Test2* */ /*@target=Test2.prop*/ t
+ . /*@target=Test2.prop*/ prop
/*@target=num.==*/ ??= getInt();
- var /*@ type=num* */ v5 = /*@ type=Test2* */ t
- . /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
+ var /*@ type=num* */ v5 = /*@ type=Test2* */ /*@target=Test2.prop*/ t
+ . /*@target=Test2.prop*/ prop
/*@target=num.==*/ ??= getNum();
- var /*@ type=num* */ v6 = /*@ type=Test2* */ t
- . /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
+ var /*@ type=num* */ v6 = /*@ type=Test2* */ /*@target=Test2.prop*/ t
+ . /*@target=Test2.prop*/ prop
/*@target=num.==*/ ??= getDouble();
var /*@ type=num* */ v7 =
/*@ type=Test2* */ t. /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
@@ -67,7 +67,7 @@
static void test3(Test3 t) {
var /*@ type=double* */ v3 = t. /*@target=Test3.prop*/ prop = getDouble();
var /*@ type=double* */ v6 =
- /*@ type=Test3* */ t. /*@target=Test3.prop*/ /*@target=Test3.prop*/
+ /*@ type=Test3* */ /*@target=Test3.prop*/ t. /*@target=Test3.prop*/
prop /*@target=num.==*/ ??= getDouble();
var /*@ type=double* */ v7 =
/*@ type=Test3* */ t. /*@target=Test3.prop*/ /*@target=Test3.prop*/ prop
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart
index 06d6032..39b30e6 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart
@@ -23,7 +23,7 @@
static void test(Test t) {
t. /*@target=Test.member*/ member = /*@ typeArgs=B* */ f();
- /*@ type=Test* */ t. /*@target=Test.member*/ /*@target=Test.member*/ member
+ /*@ type=Test* */ /*@target=Test.member*/ t. /*@target=Test.member*/ member
/*@target=A.==*/ ??= /*@ typeArgs=B* */ f();
/*@ type=Test* */ t. /*@target=Test.member*/ /*@target=Test.member*/ member
/*@target=B.+*/ += /*@ typeArgs=C* */ f();
@@ -38,8 +38,8 @@
var /*@ type=B* */ v1 =
t. /*@target=Test.member*/ member = /*@ typeArgs=B* */ f();
var /*@ type=B* */ v2 =
- /*@ type=Test* */ t
- . /*@target=Test.member*/ /*@target=Test.member*/ member
+ /*@ type=Test* */ /*@target=Test.member*/ t
+ . /*@target=Test.member*/ member
/*@target=A.==*/ ??= /*@ typeArgs=B* */ f();
var /*@ type=A* */ v3 =
/*@ type=Test* */ t
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart b/pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart
index e8cd979..15bfd3c 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_upwards.dart
@@ -15,11 +15,11 @@
static void test(Test1 t) {
var /*@ type=int* */ v1 = t. /*@target=Test1.prop*/ prop = getInt();
var /*@ type=num* */ v2 = t. /*@target=Test1.prop*/ prop = getNum();
- var /*@ type=int* */ v4 = /*@ type=Test1* */ t
- . /*@target=Test1.prop*/ /*@target=Test1.prop*/ prop
+ var /*@ type=int* */ v4 = /*@ type=Test1* */ /*@target=Test1.prop*/ t
+ . /*@target=Test1.prop*/ prop
/*@target=num.==*/ ??= getInt();
- var /*@ type=num* */ v5 = /*@ type=Test1* */ t
- . /*@target=Test1.prop*/ /*@target=Test1.prop*/ prop
+ var /*@ type=num* */ v5 = /*@ type=Test1* */ /*@target=Test1.prop*/ t
+ . /*@target=Test1.prop*/ prop
/*@target=num.==*/ ??= getNum();
var /*@ type=int* */ v7 = /*@ type=Test1* */ t
. /*@target=Test1.prop*/ /*@target=Test1.prop*/ prop
@@ -43,14 +43,14 @@
var /*@ type=int* */ v1 = t. /*@target=Test2.prop*/ prop = getInt();
var /*@ type=num* */ v2 = t. /*@target=Test2.prop*/ prop = getNum();
var /*@ type=double* */ v3 = t. /*@target=Test2.prop*/ prop = getDouble();
- var /*@ type=num* */ v4 = /*@ type=Test2* */ t
- . /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
+ var /*@ type=num* */ v4 = /*@ type=Test2* */ /*@target=Test2.prop*/ t
+ . /*@target=Test2.prop*/ prop
/*@target=num.==*/ ??= getInt();
- var /*@ type=num* */ v5 = /*@ type=Test2* */ t
- . /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
+ var /*@ type=num* */ v5 = /*@ type=Test2* */ /*@target=Test2.prop*/ t
+ . /*@target=Test2.prop*/ prop
/*@target=num.==*/ ??= getNum();
- var /*@ type=num* */ v6 = /*@ type=Test2* */ t
- . /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
+ var /*@ type=num* */ v6 = /*@ type=Test2* */ /*@target=Test2.prop*/ t
+ . /*@target=Test2.prop*/ prop
/*@target=num.==*/ ??= getDouble();
var /*@ type=num* */ v7 = /*@ type=Test2* */ t
. /*@target=Test2.prop*/ /*@target=Test2.prop*/ prop
@@ -76,11 +76,11 @@
static void test3(Test3 t) {
var /*@ type=num* */ v2 = t. /*@target=Test3.prop*/ prop = getNum();
var /*@ type=double* */ v3 = t. /*@target=Test3.prop*/ prop = getDouble();
- var /*@ type=num* */ v5 = /*@ type=Test3* */ t
- . /*@target=Test3.prop*/ /*@target=Test3.prop*/ prop
+ var /*@ type=num* */ v5 = /*@ type=Test3* */ /*@target=Test3.prop*/ t
+ . /*@target=Test3.prop*/ prop
/*@target=num.==*/ ??= getNum();
- var /*@ type=double* */ v6 = /*@ type=Test3* */ t
- . /*@target=Test3.prop*/ /*@target=Test3.prop*/ prop
+ var /*@ type=double* */ v6 = /*@ type=Test3* */ /*@target=Test3.prop*/ t
+ . /*@target=Test3.prop*/ prop
/*@target=num.==*/ ??= getDouble();
var /*@ type=double* */ v7 = /*@ type=Test3* */ t
. /*@target=Test3.prop*/ /*@target=Test3.prop*/ prop
diff --git a/pkg/front_end/testcases/inference_new/infer_instance_accessor_ref.dart b/pkg/front_end/testcases/inference_new/infer_instance_accessor_ref.dart
index 1d35c08..60d0690 100644
--- a/pkg/front_end/testcases/inference_new/infer_instance_accessor_ref.dart
+++ b/pkg/front_end/testcases/inference_new/infer_instance_accessor_ref.dart
@@ -20,7 +20,7 @@
var a = new A();
var x = a. /*@target=A.b*/ b. /*@target=B.c*/ c;
-var y = a. /*@ type=B* */ /*@target=A.b*/ b. /*@target=B.c*/ /*@target=B.c*/ c
+var y = a. /*@ type=B* */ /*@target=A.b*/ /*@target=B.c*/ b. /*@target=B.c*/ c
/*@target=C.==*/ ??= new D();
main() {}
diff --git a/pkg/front_end/testcases/inference_new/infer_instance_field_ref.dart b/pkg/front_end/testcases/inference_new/infer_instance_field_ref.dart
index 2dad28c..c05b4e9 100644
--- a/pkg/front_end/testcases/inference_new/infer_instance_field_ref.dart
+++ b/pkg/front_end/testcases/inference_new/infer_instance_field_ref.dart
@@ -19,7 +19,7 @@
var a = new A();
var x = a. /*@target=A.b*/ b. /*@target=B.c*/ c;
-var y = a. /*@ type=B* */ /*@target=A.b*/ b
- . /*@target=B.c*/ /*@target=B.c*/ c /*@target=C.==*/ ??= new D();
+var y = a. /*@ type=B* */ /*@target=A.b*/ /*@target=B.c*/ b
+ . /*@target=B.c*/ c /*@target=C.==*/ ??= new D();
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/compound.dart.weak.expect b/pkg/front_end/testcases/late_lowering/compound.dart.weak.expect
index c4340c5..eb46cbb1 100644
--- a/pkg/front_end/testcases/late_lowering/compound.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/compound.dart.weak.expect
@@ -12,33 +12,47 @@
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));
}
diff --git a/pkg/front_end/testcases/late_lowering/compound.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/compound.dart.weak.transformed.expect
index c4340c5..eb46cbb1 100644
--- a/pkg/front_end/testcases/late_lowering/compound.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/compound.dart.weak.transformed.expect
@@ -12,33 +12,47 @@
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));
}
diff --git a/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.weak.expect b/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.weak.expect
index 0d317bf..6bf2ce0 100644
--- a/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.weak.expect
@@ -16,18 +16,24 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect
index b69e0ea..a1f4e93 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.expect
@@ -77,31 +77,37 @@
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 @@
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 @@
#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 @@
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 @@
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 @@
#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));
}
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect
index b69e0ea..a1f4e93 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.weak.transformed.expect
@@ -77,31 +77,37 @@
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 @@
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 @@
#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 @@
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 @@
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 @@
#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));
}
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect
index 94edad5..72e35bb 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.expect
@@ -108,16 +108,22 @@
}
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 @@
}
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 @@
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 @@
}
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 @@
#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 () → 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 @@
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 @@
}
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 @@
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 @@
}
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 @@
#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 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));
}
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect
index 94edad5..72e35bb 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.weak.transformed.expect
@@ -108,16 +108,22 @@
}
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 @@
}
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 @@
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 @@
}
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 @@
#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 () → 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 @@
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 @@
}
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 @@
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 @@
}
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 @@
#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 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));
}
diff --git a/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.expect b/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.expect
index 4c0d317..6dffe96 100644
--- a/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.expect
@@ -7,9 +7,12 @@
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));
}
diff --git a/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.transformed.expect
index 4c0d317..6dffe96 100644
--- a/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/infer_from_late_variable.dart.weak.transformed.expect
@@ -7,9 +7,12 @@
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));
}
diff --git a/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.expect b/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.expect
index 1edfa3c..4747968 100644
--- a/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.expect
@@ -6,11 +6,13 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.transformed.expect
index 1edfa3c..4747968 100644
--- a/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.weak.transformed.expect
@@ -6,11 +6,13 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.expect b/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.expect
index ea024bb..e2b0019 100644
--- a/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.expect
@@ -15,16 +15,19 @@
@#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 {
diff --git a/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.transformed.expect
index ea024bb..e2b0019 100644
--- a/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/injected_late_field_checks/main.dart.weak.transformed.expect
@@ -15,16 +15,19 @@
@#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 {
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.expect
index 0cfc574..9dc836f 100644
--- a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.expect
@@ -4,22 +4,30 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.transformed.expect
index 0cfc574..9dc836f 100644
--- a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.weak.transformed.expect
@@ -4,22 +4,30 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.expect
index 2a32553..1fa0843 100644
--- a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.expect
@@ -5,22 +5,25 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.transformed.expect
index 2a32553..1fa0843 100644
--- a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.weak.transformed.expect
@@ -5,22 +5,25 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.expect
index cdd56ea..180d337 100644
--- a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.expect
@@ -5,25 +5,28 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.transformed.expect
index cdd56ea..180d337 100644
--- a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.weak.transformed.expect
@@ -5,25 +5,28 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.expect b/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.expect
index ecf82f3..266abad 100644
--- a/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.expect
@@ -6,15 +6,23 @@
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};
}
diff --git a/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.transformed.expect
index ecf82f3..266abad 100644
--- a/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/issue40373.dart.weak.transformed.expect
@@ -6,15 +6,23 @@
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};
}
diff --git a/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.expect b/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.expect
index 2f75d09..aead618 100644
--- a/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.expect
@@ -5,16 +5,19 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.transformed.expect
index 2f75d09..aead618 100644
--- a/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/issue40805.dart.weak.transformed.expect
@@ -5,16 +5,19 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.expect b/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.expect
index 139a488..3872041 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.expect
@@ -15,13 +15,16 @@
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;
diff --git a/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.transformed.expect
index 139a488..3872041 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436/issue41436.dart.weak.transformed.expect
@@ -15,13 +15,16 @@
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;
diff --git a/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.expect b/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.expect
index 61c5d86..34bca462 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.expect
@@ -5,13 +5,16 @@
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;
diff --git a/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.transformed.expect
index 61c5d86..34bca462 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436b.dart.weak.transformed.expect
@@ -5,13 +5,16 @@
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;
diff --git a/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.expect b/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.expect
index 05bf5e3..432f8c1 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.expect
@@ -9,10 +9,14 @@
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 @@
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 @@
}
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=
}
diff --git a/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.transformed.expect
index 05bf5e3..432f8c1 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436c/issue41436c.dart.weak.transformed.expect
@@ -9,10 +9,14 @@
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 @@
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 @@
}
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=
}
diff --git a/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.expect
index 44d325d..671dae2 100644
--- a/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.expect
@@ -10,158 +10,209 @@
}
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};
diff --git a/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.transformed.expect
index 44d325d..671dae2 100644
--- a/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_annotations.dart.weak.transformed.expect
@@ -10,158 +10,209 @@
}
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};
diff --git a/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.expect
index d9bfacd..ce355da 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.expect
@@ -14,10 +14,17 @@
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 @@
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::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();
diff --git a/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.transformed.expect
index d9bfacd..ce355da 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_inference.dart.weak.transformed.expect
@@ -14,10 +14,17 @@
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 @@
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::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();
diff --git a/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.expect
index 4030034..f6025fa 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.expect
@@ -4,8 +4,11 @@
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 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.transformed.expect
index 4030034..f6025fa 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.weak.transformed.expect
@@ -4,8 +4,11 @@
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 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.expect
index 28513d18..4d4ab11 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.expect
@@ -5,30 +5,39 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.transformed.expect
index 28513d18..4d4ab11 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.weak.transformed.expect
@@ -5,30 +5,39 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.expect
index e1e5f51..4b5e6e4 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.expect
@@ -23,10 +23,13 @@
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 @@
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;
}
diff --git a/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.transformed.expect
index e1e5f51..4b5e6e4 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.weak.transformed.expect
@@ -23,10 +23,13 @@
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 @@
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;
}
diff --git a/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.expect
index 6c0bb20..381a0ba 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.expect
@@ -5,25 +5,32 @@
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 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.transformed.expect
index 6c0bb20..381a0ba 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.weak.transformed.expect
@@ -5,25 +5,32 @@
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 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.expect
index 2f84c91..bfa3459 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.expect
@@ -8,8 +8,14 @@
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);
diff --git a/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.transformed.expect
index 2f84c91..bfa3459 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_local_with_initializer.dart.weak.transformed.expect
@@ -8,8 +8,14 @@
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);
diff --git a/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.expect
index 3476c20..7a343a9 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.expect
@@ -6,13 +6,16 @@
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 @@
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);
diff --git a/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.transformed.expect
index 3476c20..7a343a9 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_local_without_initializer.dart.weak.transformed.expect
@@ -6,13 +6,16 @@
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 @@
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);
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect
index 6a5587c..ad35343 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.expect
@@ -149,10 +149,17 @@
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();
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect
index 6a5587c..ad35343 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.weak.transformed.expect
@@ -149,10 +149,17 @@
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();
diff --git a/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.expect
index 9fbaf26..81e2022 100644
--- a/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.expect
@@ -4,10 +4,18 @@
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 @@
}
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));
diff --git a/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.transformed.expect
index 9fbaf26..81e2022 100644
--- a/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_local_with_initializer.dart.weak.transformed.expect
@@ -4,10 +4,18 @@
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 @@
}
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));
diff --git a/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.expect b/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.expect
index eaf2671..9c46d6e 100644
--- a/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.expect
@@ -5,10 +5,13 @@
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 @@
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));
diff --git a/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.transformed.expect
index eaf2671..9c46d6e 100644
--- a/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/late_local_without_initializer.dart.weak.transformed.expect
@@ -5,10 +5,13 @@
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 @@
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));
diff --git a/pkg/front_end/testcases/late_lowering/later.dart.weak.expect b/pkg/front_end/testcases/late_lowering/later.dart.weak.expect
index 4646abe..78fc27d 100644
--- a/pkg/front_end/testcases/late_lowering/later.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/later.dart.weak.expect
@@ -70,17 +70,26 @@
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 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 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 {}
diff --git a/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect
index 1129833..92573ba 100644
--- a/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/later.dart.weak.transformed.expect
@@ -70,17 +70,26 @@
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 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 @@
#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;
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart
new file mode 100644
index 0000000..4881832
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart
@@ -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);
+}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.outline.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.outline.expect
new file mode 100644
index 0000000..edaef86
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.outline.expect
@@ -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
+ ;
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.strong.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.strong.expect
new file mode 100644
index 0000000..3e34630
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.strong.expect
@@ -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";
+}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.strong.transformed.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.strong.transformed.expect
new file mode 100644
index 0000000..33bd143
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.strong.transformed.expect
@@ -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";
+}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.textual_outline.expect
new file mode 100644
index 0000000..3bd3cd1
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.textual_outline.expect
@@ -0,0 +1,4 @@
+// @dart = 2.8
+import 'non_nullable_from_opt_out_lib.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..3bd3cd1
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.textual_outline_modelled.expect
@@ -0,0 +1,4 @@
+// @dart = 2.8
+import 'non_nullable_from_opt_out_lib.dart';
+
+main() {}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.weak.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.weak.expect
new file mode 100644
index 0000000..454958d
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.weak.expect
@@ -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";
+}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.weak.transformed.expect
new file mode 100644
index 0000000..454958d
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out.dart.weak.transformed.expect
@@ -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";
+}
diff --git a/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out_lib.dart b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out_lib.dart
new file mode 100644
index 0000000..96ed716
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/non_nullable_from_opt_out_lib.dart
@@ -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';
+}
diff --git a/pkg/front_end/testcases/late_lowering/override.dart.weak.expect b/pkg/front_end/testcases/late_lowering/override.dart.weak.expect
index 8e2fcee..a4add12 100644
--- a/pkg/front_end/testcases/late_lowering/override.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/override.dart.weak.expect
@@ -5,58 +5,85 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/override.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/override.dart.weak.transformed.expect
index 8e2fcee..a4add12 100644
--- a/pkg/front_end/testcases/late_lowering/override.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/override.dart.weak.transformed.expect
@@ -5,58 +5,85 @@
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
diff --git a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.expect b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.expect
index 6e5f0ef..2c3785b 100644
--- a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.expect
@@ -5,18 +5,21 @@
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 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
diff --git a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.transformed.expect
index 6e5f0ef..2c3785b 100644
--- a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.weak.transformed.expect
@@ -5,18 +5,21 @@
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 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
diff --git a/pkg/front_end/testcases/late_lowering/return_late.dart.weak.expect b/pkg/front_end/testcases/late_lowering/return_late.dart.weak.expect
index 1cc4a59..9db48a4 100644
--- a/pkg/front_end/testcases/late_lowering/return_late.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/return_late.dart.weak.expect
@@ -26,10 +26,18 @@
}
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 @@
}
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();
}
diff --git a/pkg/front_end/testcases/late_lowering/return_late.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/return_late.dart.weak.transformed.expect
index 1cc4a59..9db48a4 100644
--- a/pkg/front_end/testcases/late_lowering/return_late.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/return_late.dart.weak.transformed.expect
@@ -26,10 +26,18 @@
}
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 @@
}
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();
}
diff --git a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.expect b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.expect
index 2829fae..327729a 100644
--- a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.expect
+++ b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.expect
@@ -5,15 +5,18 @@
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 {}
diff --git a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.transformed.expect b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.transformed.expect
index 2829fae..327729a 100644
--- a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.weak.transformed.expect
@@ -5,15 +5,18 @@
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 {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart b/pkg/front_end/testcases/nnbd/issue43278.dart
new file mode 100644
index 0000000..6bc9bbf
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart
@@ -0,0 +1,33 @@
+// 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.
+
+class A {
+ int? foo;
+ A bar;
+
+ A(this.bar);
+}
+
+test<T extends A?>(A? a, T t, dynamic d, int x) {
+ a.foo ??= x; // Error.
+ t.foo ??= x; // Error.
+ d.foo ??= x; // Ok.
+ a?.bar.foo ??= x; // Ok.
+}
+
+class B {}
+
+extension Extension on B {
+ int? get fooExtension => null;
+ void set fooExtension(int? value) {}
+ B get barExtension => new B();
+}
+
+testExtension<T extends B?>(B? b, T t, int x) {
+ b.fooExtension ??= x; // Error.
+ t.fooExtension ??= x; // Error.
+ b?.barExtension.fooExtension ??= x; // Ok.
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.outline.expect
new file mode 100644
index 0000000..1ca6277
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.outline.expect
@@ -0,0 +1,31 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int? foo;
+ field self::A bar;
+ constructor •(self::A bar) → self::A
+ ;
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B
+ ;
+}
+extension Extension on self::B {
+ get fooExtension = self::Extension|get#fooExtension;
+ get barExtension = self::Extension|get#barExtension;
+ set fooExtension = self::Extension|set#fooExtension;
+}
+static method test<T extends self::A? = self::A?>(self::A? a, self::test::T% t, dynamic d, core::int x) → dynamic
+ ;
+static method Extension|get#fooExtension(final self::B #this) → core::int?
+ ;
+static method Extension|set#fooExtension(final self::B #this, core::int? value) → void
+ ;
+static method Extension|get#barExtension(final self::B #this) → self::B
+ ;
+static method testExtension<T extends self::B? = self::B?>(self::B? b, self::testExtension::T% t, core::int x) → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.strong.expect
new file mode 100644
index 0000000..7ca309b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.strong.expect
@@ -0,0 +1,91 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+// - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// a.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+// - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// b.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int? foo = null;
+ field self::A bar;
+ constructor •(self::A bar) → self::A
+ : self::A::bar = bar, super core::Object::•()
+ ;
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B
+ : super core::Object::•()
+ ;
+}
+extension Extension on self::B {
+ get fooExtension = self::Extension|get#fooExtension;
+ get barExtension = self::Extension|get#barExtension;
+ set fooExtension = self::Extension|set#fooExtension;
+}
+static method test<T extends self::A? = self::A?>(self::A? a, self::test::T% t, dynamic d, core::int x) → dynamic {
+ let final self::A? #t1 = a in (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo} = x : null;
+ let final self::test::T% #t4 = t in (let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo} = x : null;
+ let final dynamic #t7 = d in #t7.foo.{core::Object::==}(null) ?{dynamic} #t7.foo = x : null;
+ let final self::A? #t8 = a in #t8.{core::Object::==}(null) ?{core::int?} null : let final self::A #t9 = #t8{self::A}.{self::A::bar} in #t9.{self::A::foo}.{core::num::==}(null) ?{core::int} #t9.{self::A::foo} = x : null;
+}
+static method Extension|get#fooExtension(final self::B #this) → core::int?
+ return null;
+static method Extension|set#fooExtension(final self::B #this, core::int? value) → void {}
+static method Extension|get#barExtension(final self::B #this) → self::B
+ return new self::B::•();
+static method testExtension<T extends self::B? = self::B?>(self::B? b, self::testExtension::T% t, core::int x) → dynamic {
+ let final self::B? #t10 = b in (let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t10)).{core::num::==}(null) ?{core::int} let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t10, x) : null;
+ let final self::testExtension::T% #t13 = t in (let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t13)).{core::num::==}(null) ?{core::int} let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t13, x) : null;
+ let final self::B? #t16 = b in #t16.{core::Object::==}(null) ?{core::int?} null : let final self::B #t17 = self::Extension|get#barExtension(#t16{self::B}) in self::Extension|get#fooExtension(#t17).{core::num::==}(null) ?{core::int} self::Extension|set#fooExtension(#t17, x) : null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.strong.transformed.expect
new file mode 100644
index 0000000..7ca309b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.strong.transformed.expect
@@ -0,0 +1,91 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+// - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// a.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+// - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// b.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int? foo = null;
+ field self::A bar;
+ constructor •(self::A bar) → self::A
+ : self::A::bar = bar, super core::Object::•()
+ ;
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B
+ : super core::Object::•()
+ ;
+}
+extension Extension on self::B {
+ get fooExtension = self::Extension|get#fooExtension;
+ get barExtension = self::Extension|get#barExtension;
+ set fooExtension = self::Extension|set#fooExtension;
+}
+static method test<T extends self::A? = self::A?>(self::A? a, self::test::T% t, dynamic d, core::int x) → dynamic {
+ let final self::A? #t1 = a in (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo} = x : null;
+ let final self::test::T% #t4 = t in (let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo} = x : null;
+ let final dynamic #t7 = d in #t7.foo.{core::Object::==}(null) ?{dynamic} #t7.foo = x : null;
+ let final self::A? #t8 = a in #t8.{core::Object::==}(null) ?{core::int?} null : let final self::A #t9 = #t8{self::A}.{self::A::bar} in #t9.{self::A::foo}.{core::num::==}(null) ?{core::int} #t9.{self::A::foo} = x : null;
+}
+static method Extension|get#fooExtension(final self::B #this) → core::int?
+ return null;
+static method Extension|set#fooExtension(final self::B #this, core::int? value) → void {}
+static method Extension|get#barExtension(final self::B #this) → self::B
+ return new self::B::•();
+static method testExtension<T extends self::B? = self::B?>(self::B? b, self::testExtension::T% t, core::int x) → dynamic {
+ let final self::B? #t10 = b in (let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t10)).{core::num::==}(null) ?{core::int} let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t10, x) : null;
+ let final self::testExtension::T% #t13 = t in (let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t13)).{core::num::==}(null) ?{core::int} let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t13, x) : null;
+ let final self::B? #t16 = b in #t16.{core::Object::==}(null) ?{core::int?} null : let final self::B #t17 = self::Extension|get#barExtension(#t16{self::B}) in self::Extension|get#fooExtension(#t17).{core::num::==}(null) ?{core::int} self::Extension|set#fooExtension(#t17, x) : null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.textual_outline.expect
new file mode 100644
index 0000000..989f770
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.textual_outline.expect
@@ -0,0 +1,11 @@
+class A {
+ int? foo;
+ A bar;
+ A(this.bar);
+}
+test<T extends A?>(A? a, T t, dynamic d, int x) {}
+class B {}
+extension Extension ;
+on B (){}
+testExtension<T extends B?>(B? b, T t, int x) {}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..ffcd116
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.textual_outline_modelled.expect
@@ -0,0 +1,9 @@
+bar<T extends A?>(A? a, T t, dynamic d, int x) {}
+
+class A {
+ A(this.bar);
+ A bar;
+ int? foo;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.weak.expect
new file mode 100644
index 0000000..7ca309b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.weak.expect
@@ -0,0 +1,91 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+// - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// a.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+// - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// b.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int? foo = null;
+ field self::A bar;
+ constructor •(self::A bar) → self::A
+ : self::A::bar = bar, super core::Object::•()
+ ;
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B
+ : super core::Object::•()
+ ;
+}
+extension Extension on self::B {
+ get fooExtension = self::Extension|get#fooExtension;
+ get barExtension = self::Extension|get#barExtension;
+ set fooExtension = self::Extension|set#fooExtension;
+}
+static method test<T extends self::A? = self::A?>(self::A? a, self::test::T% t, dynamic d, core::int x) → dynamic {
+ let final self::A? #t1 = a in (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo} = x : null;
+ let final self::test::T% #t4 = t in (let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo} = x : null;
+ let final dynamic #t7 = d in #t7.foo.{core::Object::==}(null) ?{dynamic} #t7.foo = x : null;
+ let final self::A? #t8 = a in #t8.{core::Object::==}(null) ?{core::int?} null : let final self::A #t9 = #t8{self::A}.{self::A::bar} in #t9.{self::A::foo}.{core::num::==}(null) ?{core::int} #t9.{self::A::foo} = x : null;
+}
+static method Extension|get#fooExtension(final self::B #this) → core::int?
+ return null;
+static method Extension|set#fooExtension(final self::B #this, core::int? value) → void {}
+static method Extension|get#barExtension(final self::B #this) → self::B
+ return new self::B::•();
+static method testExtension<T extends self::B? = self::B?>(self::B? b, self::testExtension::T% t, core::int x) → dynamic {
+ let final self::B? #t10 = b in (let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t10)).{core::num::==}(null) ?{core::int} let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t10, x) : null;
+ let final self::testExtension::T% #t13 = t in (let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t13)).{core::num::==}(null) ?{core::int} let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t13, x) : null;
+ let final self::B? #t16 = b in #t16.{core::Object::==}(null) ?{core::int?} null : let final self::B #t17 = self::Extension|get#barExtension(#t16{self::B}) in self::Extension|get#fooExtension(#t17).{core::num::==}(null) ?{core::int} self::Extension|set#fooExtension(#t17, x) : null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue43278.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue43278.dart.weak.transformed.expect
new file mode 100644
index 0000000..7ca309b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43278.dart.weak.transformed.expect
@@ -0,0 +1,91 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+// - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// a.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.foo ??= x; // Error.
+// ^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+// - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+// Try accessing using ?. instead.
+// b.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+// Try accessing using ?. instead.
+// t.fooExtension ??= x; // Error.
+// ^^^^^^^^^^^^
+//
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int? foo = null;
+ field self::A bar;
+ constructor •(self::A bar) → self::A
+ : self::A::bar = bar, super core::Object::•()
+ ;
+}
+class B extends core::Object {
+ synthetic constructor •() → self::B
+ : super core::Object::•()
+ ;
+}
+extension Extension on self::B {
+ get fooExtension = self::Extension|get#fooExtension;
+ get barExtension = self::Extension|get#barExtension;
+ set fooExtension = self::Extension|set#fooExtension;
+}
+static method test<T extends self::A? = self::A?>(self::A? a, self::test::T% t, dynamic d, core::int x) → dynamic {
+ let final self::A? #t1 = a in (let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
+ - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ a.foo ??= x; // Error.
+ ^^^" in #t1.{self::A::foo} = x : null;
+ let final self::test::T% #t4 = t in (let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo}).{core::num::==}(null) ?{core::int} let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.foo ??= x; // Error.
+ ^^^" in #t4.{self::A::foo} = x : null;
+ let final dynamic #t7 = d in #t7.foo.{core::Object::==}(null) ?{dynamic} #t7.foo = x : null;
+ let final self::A? #t8 = a in #t8.{core::Object::==}(null) ?{core::int?} null : let final self::A #t9 = #t8{self::A}.{self::A::bar} in #t9.{self::A::foo}.{core::num::==}(null) ?{core::int} #t9.{self::A::foo} = x : null;
+}
+static method Extension|get#fooExtension(final self::B #this) → core::int?
+ return null;
+static method Extension|set#fooExtension(final self::B #this, core::int? value) → void {}
+static method Extension|get#barExtension(final self::B #this) → self::B
+ return new self::B::•();
+static method testExtension<T extends self::B? = self::B?>(self::B? b, self::testExtension::T% t, core::int x) → dynamic {
+ let final self::B? #t10 = b in (let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t10)).{core::num::==}(null) ?{core::int} let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
+ - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
+Try accessing using ?. instead.
+ b.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t10, x) : null;
+ let final self::testExtension::T% #t13 = t in (let final<BottomType> #t14 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t13)).{core::num::==}(null) ?{core::int} let final<BottomType> #t15 = invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
+Try accessing using ?. instead.
+ t.fooExtension ??= x; // Error.
+ ^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t13, x) : null;
+ let final self::B? #t16 = b in #t16.{core::Object::==}(null) ?{core::int?} null : let final self::B #t17 = self::Extension|get#barExtension(#t16{self::B}) in self::Extension|get#fooExtension(#t17).{core::num::==}(null) ?{core::int} self::Extension|set#fooExtension(#t17, x) : null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/null_access.dart.strong.expect b/pkg/front_end/testcases/nnbd/null_access.dart.strong.expect
index 6c5d89f..edab243 100644
--- a/pkg/front_end/testcases/nnbd/null_access.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/null_access.dart.strong.expect
@@ -191,8 +191,8 @@
^" in #t34.{self::Class::nullableField}.{core::num::+}(2)) as{TypeError,ForNonNullableByDefault} core::int?;
let final self::Class? #t37 = nullableClass in #t37.{core::Object::==}(null) ?{core::int?} null : #t37.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t37.{self::Class::nonNullableField} = 0 : null;
let final self::Class? #t38 = nullableClass in #t38.{core::Object::==}(null) ?{core::int?} null : #t38.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t38.{self::Class::nullableField} = 0 : null;
- let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40{self::Class}.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40{self::Class}.{self::Class::nonNullableField} = 0 : null;
- let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42{self::Class}.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42{self::Class}.{self::Class::nullableField} = 0 : null;
+ let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40.{self::Class::nonNullableField} = 0 : null;
+ let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42.{self::Class::nullableField} = 0 : null;
let final<BottomType> #t43 = invalid-expression "pkg/front_end/testcases/nnbd/null_access.dart:57:16: Error: Can't use an expression of type 'Class?' as a function because it's potentially null.
- 'Class' is from 'pkg/front_end/testcases/nnbd/null_access.dart'.
Try calling using ?.call instead.
diff --git a/pkg/front_end/testcases/nnbd/null_access.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/null_access.dart.strong.transformed.expect
index 980d82f..599069e 100644
--- a/pkg/front_end/testcases/nnbd/null_access.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_access.dart.strong.transformed.expect
@@ -191,8 +191,8 @@
^" in #t34.{self::Class::nullableField}.{core::num::+}(2);
let final self::Class? #t37 = nullableClass in #t37.{core::Object::==}(null) ?{core::int?} null : #t37.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t37.{self::Class::nonNullableField} = 0 : null;
let final self::Class? #t38 = nullableClass in #t38.{core::Object::==}(null) ?{core::int?} null : #t38.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t38.{self::Class::nullableField} = 0 : null;
- let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40{self::Class}.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40{self::Class}.{self::Class::nonNullableField} = 0 : null;
- let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42{self::Class}.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42{self::Class}.{self::Class::nullableField} = 0 : null;
+ let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40.{self::Class::nonNullableField} = 0 : null;
+ let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42.{self::Class::nullableField} = 0 : null;
let final<BottomType> #t43 = invalid-expression "pkg/front_end/testcases/nnbd/null_access.dart:57:16: Error: Can't use an expression of type 'Class?' as a function because it's potentially null.
- 'Class' is from 'pkg/front_end/testcases/nnbd/null_access.dart'.
Try calling using ?.call instead.
diff --git a/pkg/front_end/testcases/nnbd/null_access.dart.weak.expect b/pkg/front_end/testcases/nnbd/null_access.dart.weak.expect
index 6c5d89f..edab243 100644
--- a/pkg/front_end/testcases/nnbd/null_access.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/null_access.dart.weak.expect
@@ -191,8 +191,8 @@
^" in #t34.{self::Class::nullableField}.{core::num::+}(2)) as{TypeError,ForNonNullableByDefault} core::int?;
let final self::Class? #t37 = nullableClass in #t37.{core::Object::==}(null) ?{core::int?} null : #t37.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t37.{self::Class::nonNullableField} = 0 : null;
let final self::Class? #t38 = nullableClass in #t38.{core::Object::==}(null) ?{core::int?} null : #t38.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t38.{self::Class::nullableField} = 0 : null;
- let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40{self::Class}.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40{self::Class}.{self::Class::nonNullableField} = 0 : null;
- let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42{self::Class}.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42{self::Class}.{self::Class::nullableField} = 0 : null;
+ let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40.{self::Class::nonNullableField} = 0 : null;
+ let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42.{self::Class::nullableField} = 0 : null;
let final<BottomType> #t43 = invalid-expression "pkg/front_end/testcases/nnbd/null_access.dart:57:16: Error: Can't use an expression of type 'Class?' as a function because it's potentially null.
- 'Class' is from 'pkg/front_end/testcases/nnbd/null_access.dart'.
Try calling using ?.call instead.
diff --git a/pkg/front_end/testcases/nnbd/null_access.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/null_access.dart.weak.transformed.expect
index 980d82f..599069e 100644
--- a/pkg/front_end/testcases/nnbd/null_access.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_access.dart.weak.transformed.expect
@@ -191,8 +191,8 @@
^" in #t34.{self::Class::nullableField}.{core::num::+}(2);
let final self::Class? #t37 = nullableClass in #t37.{core::Object::==}(null) ?{core::int?} null : #t37.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t37.{self::Class::nonNullableField} = 0 : null;
let final self::Class? #t38 = nullableClass in #t38.{core::Object::==}(null) ?{core::int?} null : #t38.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t38.{self::Class::nullableField} = 0 : null;
- let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40{self::Class}.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40{self::Class}.{self::Class::nonNullableField} = 0 : null;
- let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class? #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42{self::Class}.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42{self::Class}.{self::Class::nullableField} = 0 : null;
+ let final self::Class? #t39 = nullableClass in #t39.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t40 = #t39{self::Class}.{self::Class::nonNullableClass} in #t40.{self::Class::nonNullableField}.{core::num::==}(null) ?{core::int} #t40.{self::Class::nonNullableField} = 0 : null;
+ let final self::Class? #t41 = nullableClass in #t41.{core::Object::==}(null) ?{core::int?} null : let final self::Class #t42 = #t41{self::Class}.{self::Class::nonNullableClass} in #t42.{self::Class::nullableField}.{core::num::==}(null) ?{core::int} #t42.{self::Class::nullableField} = 0 : null;
let final<BottomType> #t43 = invalid-expression "pkg/front_end/testcases/nnbd/null_access.dart:57:16: Error: Can't use an expression of type 'Class?' as a function because it's potentially null.
- 'Class' is from 'pkg/front_end/testcases/nnbd/null_access.dart'.
Try calling using ?.call instead.
diff --git a/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.expect b/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.expect
index 8f95eca..d0bb828 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.expect
@@ -253,8 +253,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t263 = n1 in #t263.{core::Object::==}(null) ?{self::Class1?} null : #t263.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t263.{self::Class1::nullable1} = n1{self::Class1} : null;
n1 = let final self::Class1? #t264 = n1 in #t264.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t265 = #t264.{self::Class1::nullable1} in #t265.{core::Object::==}(null) ?{self::Class1} #t264.{self::Class1::nullable1} = n1{self::Class1} : #t265{self::Class1};
- let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267{self::Class1}.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : null;
- n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269{self::Class1}.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
+ let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267.{self::Class1::nullable1} = n1{self::Class1} : null;
+ n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
let final self::Class1? #t271 = n1 in #t271.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t272 = #t271{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t273 = n1{self::Class1} in #t272.{self::Class1::[]}(#t273).{core::Object::==}(null) ?{self::Class1} #t272.{self::Class1::[]=}(#t273, n1{self::Class1}) : null;
n1 = let final self::Class1? #t274 = n1 in #t274.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t275 = #t274{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t276 = n1{self::Class1} in let final self::Class1? #t277 = #t275.{self::Class1::[]}(#t276) in #t277.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t278 = n1{self::Class1} in let final void #t279 = #t275.{self::Class1::[]=}(#t276, #t278) in #t278 : #t277{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.transformed.expect
index 8f95eca..d0bb828 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting.dart.strong.transformed.expect
@@ -253,8 +253,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t263 = n1 in #t263.{core::Object::==}(null) ?{self::Class1?} null : #t263.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t263.{self::Class1::nullable1} = n1{self::Class1} : null;
n1 = let final self::Class1? #t264 = n1 in #t264.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t265 = #t264.{self::Class1::nullable1} in #t265.{core::Object::==}(null) ?{self::Class1} #t264.{self::Class1::nullable1} = n1{self::Class1} : #t265{self::Class1};
- let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267{self::Class1}.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : null;
- n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269{self::Class1}.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
+ let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267.{self::Class1::nullable1} = n1{self::Class1} : null;
+ n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
let final self::Class1? #t271 = n1 in #t271.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t272 = #t271{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t273 = n1{self::Class1} in #t272.{self::Class1::[]}(#t273).{core::Object::==}(null) ?{self::Class1} #t272.{self::Class1::[]=}(#t273, n1{self::Class1}) : null;
n1 = let final self::Class1? #t274 = n1 in #t274.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t275 = #t274{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t276 = n1{self::Class1} in let final self::Class1? #t277 = #t275.{self::Class1::[]}(#t276) in #t277.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t278 = n1{self::Class1} in let final void #t279 = #t275.{self::Class1::[]=}(#t276, #t278) in #t278 : #t277{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.expect b/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.expect
index 8f95eca..d0bb828 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.expect
@@ -253,8 +253,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t263 = n1 in #t263.{core::Object::==}(null) ?{self::Class1?} null : #t263.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t263.{self::Class1::nullable1} = n1{self::Class1} : null;
n1 = let final self::Class1? #t264 = n1 in #t264.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t265 = #t264.{self::Class1::nullable1} in #t265.{core::Object::==}(null) ?{self::Class1} #t264.{self::Class1::nullable1} = n1{self::Class1} : #t265{self::Class1};
- let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267{self::Class1}.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : null;
- n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269{self::Class1}.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
+ let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267.{self::Class1::nullable1} = n1{self::Class1} : null;
+ n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
let final self::Class1? #t271 = n1 in #t271.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t272 = #t271{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t273 = n1{self::Class1} in #t272.{self::Class1::[]}(#t273).{core::Object::==}(null) ?{self::Class1} #t272.{self::Class1::[]=}(#t273, n1{self::Class1}) : null;
n1 = let final self::Class1? #t274 = n1 in #t274.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t275 = #t274{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t276 = n1{self::Class1} in let final self::Class1? #t277 = #t275.{self::Class1::[]}(#t276) in #t277.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t278 = n1{self::Class1} in let final void #t279 = #t275.{self::Class1::[]=}(#t276, #t278) in #t278 : #t277{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.transformed.expect
index 8f95eca..d0bb828 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting.dart.weak.transformed.expect
@@ -253,8 +253,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t263 = n1 in #t263.{core::Object::==}(null) ?{self::Class1?} null : #t263.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t263.{self::Class1::nullable1} = n1{self::Class1} : null;
n1 = let final self::Class1? #t264 = n1 in #t264.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t265 = #t264.{self::Class1::nullable1} in #t265.{core::Object::==}(null) ?{self::Class1} #t264.{self::Class1::nullable1} = n1{self::Class1} : #t265{self::Class1};
- let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267{self::Class1}.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : null;
- n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269{self::Class1}.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269{self::Class1}.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
+ let final self::Class1? #t266 = n1 in #t266.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t267 = #t266{self::Class1}.{self::Class1::nonNullable1} in #t267.{self::Class1::nullable1}.{core::Object::==}(null) ?{self::Class1} #t267.{self::Class1::nullable1} = n1{self::Class1} : null;
+ n1 = let final self::Class1? #t268 = n1 in #t268.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t269 = #t268{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1? #t270 = #t269.{self::Class1::nullable1} in #t270.{core::Object::==}(null) ?{self::Class1} #t269.{self::Class1::nullable1} = n1{self::Class1} : #t270{self::Class1};
let final self::Class1? #t271 = n1 in #t271.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t272 = #t271{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t273 = n1{self::Class1} in #t272.{self::Class1::[]}(#t273).{core::Object::==}(null) ?{self::Class1} #t272.{self::Class1::[]=}(#t273, n1{self::Class1}) : null;
n1 = let final self::Class1? #t274 = n1 in #t274.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t275 = #t274{self::Class1}.{self::Class1::nonNullable1} in let final self::Class1 #t276 = n1{self::Class1} in let final self::Class1? #t277 = #t275.{self::Class1::[]}(#t276) in #t277.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t278 = n1{self::Class1} in let final void #t279 = #t275.{self::Class1::[]=}(#t276, #t278) in #t278 : #t277{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.expect b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.expect
index 7dffc16..5a4a4e5 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t353 = n1 in #t353.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t353).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t353, n1{self::Class1}) : null;
n1 = let final self::Class1? #t354 = n1 in #t354.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t355 = self::Extension1|get#nullable1(#t354) in #t355.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t356 = n1{self::Class1} in let final void #t357 = self::Extension1|set#nullable1(#t354, #t356) in #t356 : #t355{self::Class1};
- let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361{self::Class1}) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361{self::Class1}, #t363) in #t363 : #t362{self::Class1};
+ let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361, #t363) in #t363 : #t362{self::Class1};
let final self::Class1? #t365 = n1 in #t365.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t366 = self::Extension1|get#nonNullable1(#t365{self::Class1}) in let final self::Class1 #t367 = n1{self::Class1} in self::Extension1|[](#t366, #t367).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t366, #t367, n1{self::Class1}) : null;
n1 = let final self::Class1? #t368 = n1 in #t368.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t369 = self::Extension1|get#nonNullable1(#t368{self::Class1}) in let final self::Class1 #t370 = n1{self::Class1} in let final self::Class1? #t371 = self::Extension1|[](#t369, #t370) in #t371.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t372 = n1{self::Class1} in let final void #t373 = self::Extension1|[]=(#t369, #t370, #t372) in #t372 : #t371{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.transformed.expect
index 7dffc16..5a4a4e5 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.strong.transformed.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t353 = n1 in #t353.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t353).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t353, n1{self::Class1}) : null;
n1 = let final self::Class1? #t354 = n1 in #t354.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t355 = self::Extension1|get#nullable1(#t354) in #t355.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t356 = n1{self::Class1} in let final void #t357 = self::Extension1|set#nullable1(#t354, #t356) in #t356 : #t355{self::Class1};
- let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361{self::Class1}) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361{self::Class1}, #t363) in #t363 : #t362{self::Class1};
+ let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361, #t363) in #t363 : #t362{self::Class1};
let final self::Class1? #t365 = n1 in #t365.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t366 = self::Extension1|get#nonNullable1(#t365{self::Class1}) in let final self::Class1 #t367 = n1{self::Class1} in self::Extension1|[](#t366, #t367).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t366, #t367, n1{self::Class1}) : null;
n1 = let final self::Class1? #t368 = n1 in #t368.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t369 = self::Extension1|get#nonNullable1(#t368{self::Class1}) in let final self::Class1 #t370 = n1{self::Class1} in let final self::Class1? #t371 = self::Extension1|[](#t369, #t370) in #t371.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t372 = n1{self::Class1} in let final void #t373 = self::Extension1|[]=(#t369, #t370, #t372) in #t372 : #t371{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.expect b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.expect
index 7dffc16..5a4a4e5 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t353 = n1 in #t353.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t353).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t353, n1{self::Class1}) : null;
n1 = let final self::Class1? #t354 = n1 in #t354.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t355 = self::Extension1|get#nullable1(#t354) in #t355.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t356 = n1{self::Class1} in let final void #t357 = self::Extension1|set#nullable1(#t354, #t356) in #t356 : #t355{self::Class1};
- let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361{self::Class1}) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361{self::Class1}, #t363) in #t363 : #t362{self::Class1};
+ let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361, #t363) in #t363 : #t362{self::Class1};
let final self::Class1? #t365 = n1 in #t365.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t366 = self::Extension1|get#nonNullable1(#t365{self::Class1}) in let final self::Class1 #t367 = n1{self::Class1} in self::Extension1|[](#t366, #t367).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t366, #t367, n1{self::Class1}) : null;
n1 = let final self::Class1? #t368 = n1 in #t368.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t369 = self::Extension1|get#nonNullable1(#t368{self::Class1}) in let final self::Class1 #t370 = n1{self::Class1} in let final self::Class1? #t371 = self::Extension1|[](#t369, #t370) in #t371.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t372 = n1{self::Class1} in let final void #t373 = self::Extension1|[]=(#t369, #t370, #t372) in #t372 : #t371{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.transformed.expect
index 7dffc16..5a4a4e5 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_explicit_extension.dart.weak.transformed.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t353 = n1 in #t353.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t353).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t353, n1{self::Class1}) : null;
n1 = let final self::Class1? #t354 = n1 in #t354.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t355 = self::Extension1|get#nullable1(#t354) in #t355.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t356 = n1{self::Class1} in let final void #t357 = self::Extension1|set#nullable1(#t354, #t356) in #t356 : #t355{self::Class1};
- let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361{self::Class1}) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361{self::Class1}, #t363) in #t363 : #t362{self::Class1};
+ let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in self::Extension1|get#nullable1(#t359).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t359, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t360 = n1 in #t360.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t361 = self::Extension1|get#nonNullable1(#t360{self::Class1}) in let final self::Class1? #t362 = self::Extension1|get#nullable1(#t361) in #t362.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t363 = n1{self::Class1} in let final void #t364 = self::Extension1|set#nullable1(#t361, #t363) in #t363 : #t362{self::Class1};
let final self::Class1? #t365 = n1 in #t365.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t366 = self::Extension1|get#nonNullable1(#t365{self::Class1}) in let final self::Class1 #t367 = n1{self::Class1} in self::Extension1|[](#t366, #t367).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t366, #t367, n1{self::Class1}) : null;
n1 = let final self::Class1? #t368 = n1 in #t368.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t369 = self::Extension1|get#nonNullable1(#t368{self::Class1}) in let final self::Class1 #t370 = n1{self::Class1} in let final self::Class1? #t371 = self::Extension1|[](#t369, #t370) in #t371.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t372 = n1{self::Class1} in let final void #t373 = self::Extension1|[]=(#t369, #t370, #t372) in #t372 : #t371{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.expect b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.expect
index f93ce59..45fd2888 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t351 = n1 in #t351.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t351).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t351, n1{self::Class1}) : null;
n1 = let final self::Class1? #t352 = n1 in #t352.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t353 = self::Extension1|get#nullable1(#t352) in #t353.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t354 = n1{self::Class1} in let final void #t355 = self::Extension1|set#nullable1(#t352, #t354) in #t354 : #t353{self::Class1};
- let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359{self::Class1}) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359{self::Class1}, #t361) in #t361 : #t360{self::Class1};
+ let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359, #t361) in #t361 : #t360{self::Class1};
let final self::Class1? #t363 = n1 in #t363.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t364 = self::Extension1|get#nonNullable1(#t363{self::Class1}) in let final self::Class1 #t365 = n1{self::Class1} in self::Extension1|[](#t364, #t365).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t364, #t365, n1{self::Class1}) : null;
n1 = let final self::Class1? #t366 = n1 in #t366.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t367 = self::Extension1|get#nonNullable1(#t366{self::Class1}) in let final self::Class1 #t368 = n1{self::Class1} in let final self::Class1? #t369 = self::Extension1|[](#t367, #t368) in #t369.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t370 = n1{self::Class1} in let final void #t371 = self::Extension1|[]=(#t367, #t368, #t370) in #t370 : #t369{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.transformed.expect
index f93ce59..45fd2888 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.strong.transformed.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t351 = n1 in #t351.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t351).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t351, n1{self::Class1}) : null;
n1 = let final self::Class1? #t352 = n1 in #t352.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t353 = self::Extension1|get#nullable1(#t352) in #t353.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t354 = n1{self::Class1} in let final void #t355 = self::Extension1|set#nullable1(#t352, #t354) in #t354 : #t353{self::Class1};
- let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359{self::Class1}) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359{self::Class1}, #t361) in #t361 : #t360{self::Class1};
+ let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359, #t361) in #t361 : #t360{self::Class1};
let final self::Class1? #t363 = n1 in #t363.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t364 = self::Extension1|get#nonNullable1(#t363{self::Class1}) in let final self::Class1 #t365 = n1{self::Class1} in self::Extension1|[](#t364, #t365).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t364, #t365, n1{self::Class1}) : null;
n1 = let final self::Class1? #t366 = n1 in #t366.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t367 = self::Extension1|get#nonNullable1(#t366{self::Class1}) in let final self::Class1 #t368 = n1{self::Class1} in let final self::Class1? #t369 = self::Extension1|[](#t367, #t368) in #t369.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t370 = n1{self::Class1} in let final void #t371 = self::Extension1|[]=(#t367, #t368, #t370) in #t370 : #t369{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.expect b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.expect
index f93ce59..45fd2888 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t351 = n1 in #t351.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t351).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t351, n1{self::Class1}) : null;
n1 = let final self::Class1? #t352 = n1 in #t352.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t353 = self::Extension1|get#nullable1(#t352) in #t353.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t354 = n1{self::Class1} in let final void #t355 = self::Extension1|set#nullable1(#t352, #t354) in #t354 : #t353{self::Class1};
- let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359{self::Class1}) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359{self::Class1}, #t361) in #t361 : #t360{self::Class1};
+ let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359, #t361) in #t361 : #t360{self::Class1};
let final self::Class1? #t363 = n1 in #t363.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t364 = self::Extension1|get#nonNullable1(#t363{self::Class1}) in let final self::Class1 #t365 = n1{self::Class1} in self::Extension1|[](#t364, #t365).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t364, #t365, n1{self::Class1}) : null;
n1 = let final self::Class1? #t366 = n1 in #t366.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t367 = self::Extension1|get#nonNullable1(#t366{self::Class1}) in let final self::Class1 #t368 = n1{self::Class1} in let final self::Class1? #t369 = self::Extension1|[](#t367, #t368) in #t369.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t370 = n1{self::Class1} in let final void #t371 = self::Extension1|[]=(#t367, #t368, #t370) in #t370 : #t369{self::Class1};
}
diff --git a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.transformed.expect
index f93ce59..45fd2888 100644
--- a/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/null_shorting_extension.dart.weak.transformed.expect
@@ -282,8 +282,8 @@
self::Class1? nullable1 = n1;
let final self::Class1? #t351 = n1 in #t351.{core::Object::==}(null) ?{self::Class1?} null : self::Extension1|get#nullable1(#t351).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t351, n1{self::Class1}) : null;
n1 = let final self::Class1? #t352 = n1 in #t352.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t353 = self::Extension1|get#nullable1(#t352) in #t353.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t354 = n1{self::Class1} in let final void #t355 = self::Extension1|set#nullable1(#t352, #t354) in #t354 : #t353{self::Class1};
- let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357{self::Class1}).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357{self::Class1}, n1{self::Class1}) : null;
- n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1? #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359{self::Class1}) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359{self::Class1}, #t361) in #t361 : #t360{self::Class1};
+ let final self::Class1? #t356 = n1 in #t356.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t357 = self::Extension1|get#nonNullable1(#t356{self::Class1}) in self::Extension1|get#nullable1(#t357).{core::Object::==}(null) ?{self::Class1} self::Extension1|set#nullable1(#t357, n1{self::Class1}) : null;
+ n1 = let final self::Class1? #t358 = n1 in #t358.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t359 = self::Extension1|get#nonNullable1(#t358{self::Class1}) in let final self::Class1? #t360 = self::Extension1|get#nullable1(#t359) in #t360.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t361 = n1{self::Class1} in let final void #t362 = self::Extension1|set#nullable1(#t359, #t361) in #t361 : #t360{self::Class1};
let final self::Class1? #t363 = n1 in #t363.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t364 = self::Extension1|get#nonNullable1(#t363{self::Class1}) in let final self::Class1 #t365 = n1{self::Class1} in self::Extension1|[](#t364, #t365).{core::Object::==}(null) ?{self::Class1} self::Extension1|[]=(#t364, #t365, n1{self::Class1}) : null;
n1 = let final self::Class1? #t366 = n1 in #t366.{core::Object::==}(null) ?{self::Class1?} null : let final self::Class1 #t367 = self::Extension1|get#nonNullable1(#t366{self::Class1}) in let final self::Class1 #t368 = n1{self::Class1} in let final self::Class1? #t369 = self::Extension1|[](#t367, #t368) in #t369.{core::Object::==}(null) ?{self::Class1} let final self::Class1 #t370 = n1{self::Class1} in let final void #t371 = self::Extension1|[]=(#t367, #t368, #t370) in #t370 : #t369{self::Class1};
}
diff --git a/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.expect b/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.expect
index d53be31..1fcac9d 100644
--- a/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.expect
+++ b/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.expect
@@ -9,26 +9,39 @@
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 @@
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 @@
}
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 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 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.transformed.expect b/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.transformed.expect
index d53be31..1fcac9d 100644
--- a/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/static_field_lowering/opt_in.dart.weak.transformed.expect
@@ -9,26 +9,39 @@
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 @@
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 @@
}
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 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 @@
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 @@
}
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;
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 524c1c577..955761c 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -171,6 +171,7 @@
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
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index b68d320..ccd0d03 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -169,6 +169,7 @@
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
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index 229c220..5565670 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -42,16 +42,16 @@
extensions/extension_constructor: FormatterCrash
extensions/extension_field_with_type_parameter_usage: FormatterCrash
extensions/extension_methods: FormatterCrash
-extensions/extension_setter_error: FormatterCrash
extensions/extension_setter: FormatterCrash
+extensions/extension_setter_error: FormatterCrash
extensions/generic_function_in_generic_extension: FormatterCrash
extensions/getter_setter_conflict: FormatterCrash
extensions/if_null: FormatterCrash
extensions/implicit_extension_inference: FormatterCrash
extensions/implicit_this: FormatterCrash
extensions/index: FormatterCrash
-extensions/instance_access_of_static: FormatterCrash
extensions/instance_access: FormatterCrash
+extensions/instance_access_of_static: FormatterCrash
extensions/instance_members: FormatterCrash
extensions/instance_tearoff: FormatterCrash
extensions/internal_resolution: FormatterCrash
@@ -77,22 +77,12 @@
extensions/on_type_variable_inference: FormatterCrash
extensions/operators: FormatterCrash
extensions/other_kinds: FormatterCrash
-extensions/static_access_of_instance: FormatterCrash
extensions/static_access: FormatterCrash
+extensions/static_access_of_instance: FormatterCrash
extensions/tear_offs: FormatterCrash
extensions/type_variables: FormatterCrash
extensions/unnamed_extensions: FormatterCrash
extensions/use_this: FormatterCrash
-general_nnbd_opt_out/annotation_eof: FormatterCrash
-general_nnbd_opt_out/bad_setter_abstract: FormatterCrash
-general_nnbd_opt_out/bug31124: FormatterCrash
-general_nnbd_opt_out/clone_function_type: FormatterCrash
-general_nnbd_opt_out/constructor_initializer_invalid: FormatterCrash
-general_nnbd_opt_out/duplicated_declarations: FormatterCrash
-general_nnbd_opt_out/function_type_default_value: FormatterCrash
-general_nnbd_opt_out/incomplete_field_formal_parameter: FormatterCrash
-general_nnbd_opt_out/many_errors: FormatterCrash
-general_nnbd_opt_out/var_as_type_name: FormatterCrash
general/annotation_eof: FormatterCrash
general/bad_setter_abstract: FormatterCrash
general/bug31124: FormatterCrash
@@ -116,8 +106,8 @@
general/error_recovery/issue_39958_01: FormatterCrash
general/function_type_default_value: FormatterCrash
general/incomplete_field_formal_parameter: FormatterCrash
-general/invalid_operator: FormatterCrash
general/invalid_operator2: FormatterCrash
+general/invalid_operator: FormatterCrash
general/issue40242: FormatterCrash
general/issue42997: FormatterCrash
general/many_errors: FormatterCrash
@@ -126,6 +116,16 @@
general/type_parameters_on_void: FormatterCrash
general/var_as_type_name: FormatterCrash
general/well_boundness_checks_in_outline: FormatterCrash
+general_nnbd_opt_out/annotation_eof: FormatterCrash
+general_nnbd_opt_out/bad_setter_abstract: FormatterCrash
+general_nnbd_opt_out/bug31124: FormatterCrash
+general_nnbd_opt_out/clone_function_type: FormatterCrash
+general_nnbd_opt_out/constructor_initializer_invalid: FormatterCrash
+general_nnbd_opt_out/duplicated_declarations: FormatterCrash
+general_nnbd_opt_out/function_type_default_value: FormatterCrash
+general_nnbd_opt_out/incomplete_field_formal_parameter: FormatterCrash
+general_nnbd_opt_out/many_errors: FormatterCrash
+general_nnbd_opt_out/var_as_type_name: FormatterCrash
inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: FormatterCrash
inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1: FormatterCrash
late_lowering/covariant_late_field: FormatterCrash
@@ -155,16 +155,9 @@
late_lowering/late_nullable_field_with_initializer: FormatterCrash
late_lowering/late_nullable_field_without_initializer: FormatterCrash
late_lowering/later: FormatterCrash
-late_lowering/override_getter_setter: FormatterCrash
late_lowering/override: FormatterCrash
+late_lowering/override_getter_setter: FormatterCrash
late_lowering/uninitialized_non_nullable_late_fields: FormatterCrash
-nnbd_mixed/inheritance_from_opt_in: FormatterCrash
-nnbd_mixed/issue41597: FormatterCrash
-nnbd_mixed/no_null_shorting_explicit_extension: FormatterCrash
-nnbd_mixed/no_null_shorting_extension: FormatterCrash
-nnbd_mixed/null_safety_invalid_language_version: FormatterCrash
-nnbd_mixed/nullable_extension_on_opt_out: FormatterCrash
-nnbd_mixed/opt_out: FormatterCrash
nnbd/abstract_field_errors: FormatterCrash
nnbd/covariant_late_field: FormatterCrash
nnbd/extension_bounds: FormatterCrash
@@ -177,6 +170,7 @@
nnbd/issue40805: FormatterCrash
nnbd/issue41349: FormatterCrash
nnbd/issue41597: FormatterCrash
+nnbd/issue43278: FormatterCrash
nnbd/late: FormatterCrash
nnbd/later: FormatterCrash
nnbd/no_null_shorting_explicit_extension: FormatterCrash
@@ -193,6 +187,13 @@
nnbd/potentially_nullable_access: FormatterCrash
nnbd/strictly_non_nullable_warnings: FormatterCrash
nnbd/uninitialized_non_nullable_late_fields: FormatterCrash
+nnbd_mixed/inheritance_from_opt_in: FormatterCrash
+nnbd_mixed/issue41597: FormatterCrash
+nnbd_mixed/no_null_shorting_explicit_extension: FormatterCrash
+nnbd_mixed/no_null_shorting_extension: FormatterCrash
+nnbd_mixed/null_safety_invalid_language_version: FormatterCrash
+nnbd_mixed/nullable_extension_on_opt_out: FormatterCrash
+nnbd_mixed/opt_out: FormatterCrash
nonfunction_type_aliases/issue41501: FormatterCrash
rasta/bad_redirection: FormatterCrash
rasta/issue_000032: FormatterCrash
@@ -233,3 +234,4 @@
variance/generic_covariance_sound_variance: FormatterCrash
variance/mixin_type_parameter_modifier: FormatterCrash
variance/unconstrained_inference: FormatterCrash
+
diff --git a/pkg/kernel/lib/default_language_version.dart b/pkg/kernel/lib/default_language_version.dart
index 6b7b18c..eb90980 100644
--- a/pkg/kernel/lib/default_language_version.dart
+++ b/pkg/kernel/lib/default_language_version.dart
@@ -9,4 +9,4 @@
import "ast.dart";
-Version defaultLanguageVersion = const Version(2, 10);
+Version defaultLanguageVersion = const Version(2, 11);
diff --git a/sdk/lib/_internal/js_runtime/pubspec.yaml b/sdk/lib/_internal/js_runtime/pubspec.yaml
index 96abf65..f42b2cd 100644
--- a/sdk/lib/_internal/js_runtime/pubspec.yaml
+++ b/sdk/lib/_internal/js_runtime/pubspec.yaml
@@ -2,5 +2,3 @@
# make it easier to develop on dart2js.
name: js_runtime
publish_to: none
-environment:
- sdk: '>=2.10.0-0.0 <3.0.0'
diff --git a/sdk/lib/_internal/sdk_library_metadata/pubspec.yaml b/sdk/lib/_internal/sdk_library_metadata/pubspec.yaml
index 8f46e53..79b69ee 100644
--- a/sdk/lib/_internal/sdk_library_metadata/pubspec.yaml
+++ b/sdk/lib/_internal/sdk_library_metadata/pubspec.yaml
@@ -2,5 +2,3 @@
# make it easer to depend on libraries.dart from sdk packages like dart2js.
name: sdk_library_metadata
publish_to: none
-environment:
- sdk: '>=2.10.0-0.0 <3.0.0'
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index 4bfc333..358ce45 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -23,7 +23,6 @@
Language/Reference/Operator_Precedence/precedence_01_assignment_t14: Skip # Triple shift is not implemented yet
Language/Reference/Operator_Precedence/precedence_12_Shift_t04: Skip # Triple shift is not implemented yet
Language/Reference/Operator_Precedence/precedence_t05: Skip # Triple shift is not implemented yet
-Language/Statements/Assert/*: Skip # Not migrated to NNBD
Language/Statements/Expression_Statements/syntax_t06: Skip # Type aliases are not fully implemented
Language/Types/Type_Aliases/built-in_types_t11: Skip # Triple shift is not implemented yet
LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A15_t09: Skip # Triple shift is not implemented yet
@@ -44,17 +43,7 @@
LanguageFeatures/Simple-bounds/static/type-aliases/*: Skip # Not migrated to NNBD
LanguageFeatures/Spread-collections/*: Skip # Not migrated to NNBD
LanguageFeatures/Triple-Shift/*: Skip # Triple shift is not implemented yet
-LanguageFeatures/int-to-double/*: Skip # Not migrated to NNBD
LanguageFeatures/regression/34560_t02/01: Skip # Type aliases are not fully implemented
-LibTest/html/CanvasRenderingContext2D/*: Skip # Not migrated to NNBD
-LibTest/html/Document/*: Skip # Not migrated to NNBD
-LibTest/html/Element/*: Skip # Not migrated to NNBD
-LibTest/html/Event/*: Skip # Not migrated to NNBD
-LibTest/html/HttpRequest/*: Skip # Not migrated to NNBD
-LibTest/html/HttpRequestUpload/*: Skip # Not migrated to NNBD
-LibTest/html/IFrameElement/*: Skip # Not migrated to NNBD
-LibTest/html/Node/*: Skip # Not migrated to NNBD
-LibTest/html/Window/*: Skip # Not migrated to NNBD
LibTest/io/RawDatagramSocket/*: Skip # https://github.com/dart-lang/co19/issues/195
[ $compiler == dart2analyzer ]
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 2cf6be3..8319487 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -30,6 +30,8 @@
LibTest/core/int/operator_truncating_division_A01_t02: SkipByDesign # Division by zero is not an error in JavaScript
LibTest/core/int/parse_A01_t02: SkipByDesign # big integers cannot be represented in JavaScript
LibTest/core/int/remainder_A01_t03: SkipByDesign # Division by zero is not an error in JavaScript
+LibTest/html/HttpRequest/*: Skip # https://github.com/dart-lang/co19/issues/932
+LibTest/html/HttpRequestUpload/*: Skip # https://github.com/dart-lang/co19/issues/932
LibTest/io/*: SkipByDesign # dart:io not supported.
LibTest/isolate/*: SkipByDesign # dart:isolate not supported.
LibTest/mirrors/*: SkipByDesign # dart:mirrors is not supported
diff --git a/tests/co19/co19-dartdevc.status b/tests/co19/co19-dartdevc.status
index 23dd0d4..50a7573 100644
--- a/tests/co19/co19-dartdevc.status
+++ b/tests/co19/co19-dartdevc.status
@@ -83,26 +83,12 @@
LibTest/core/int/operator_truncating_division_A01_t02: SkipByDesign # Division by zero is not an error in JavaScript
LibTest/core/int/parse_A01_t02: SkipByDesign # big integers cannot be represented in JavaScript
LibTest/core/int/remainder_A01_t03: SkipByDesign # Division by zero is not an error in JavaScript
-LibTest/html/CanvasRenderingContext2D/addEventListener_A01_t03: Skip # Times out
LibTest/html/Element/blur_A01_t01: Skip # Times out
LibTest/html/Element/focus_A01_t01: Skip # Times out
-LibTest/html/Element/loadEvent_A01_t01: Skip # Times out
-LibTest/html/Element/mouseWheelEvent_A01_t01: Skip # Times out
-LibTest/html/Element/onLoad_A01_t01: Skip # Times out
-LibTest/html/Element/onMouseWheel_A01_t01: Skip # Times out
-LibTest/html/Element/onTransitionEnd_A01_t01: Skip # Times out
-LibTest/html/Element/transitionEndEvent_A01_t01: Skip # Times out
-LibTest/html/HttpRequest/onError_A01_t02: Skip # Times out
-LibTest/html/HttpRequest/responseText_A01_t02: Skip # Times out
-LibTest/html/HttpRequestUpload/onError_A01_t02: Skip # Times out
-LibTest/html/HttpRequestUpload/onLoadEnd_A01_t01: Skip # Times out
-LibTest/html/HttpRequestUpload/onLoadStart_A01_t01: Skip # Times out
-LibTest/html/HttpRequestUpload/onLoad_A01_t01: Skip # Times out
+LibTest/html/HttpRequest/*: Skip # https://github.com/dart-lang/co19/issues/932
+LibTest/html/HttpRequestUpload/*: Skip # https://github.com/dart-lang/co19/issues/932
LibTest/html/IFrameElement/blur_A01_t01: Skip # Times out
-LibTest/html/IFrameElement/enteredView_A01_t01: Skip # Times out
LibTest/html/IFrameElement/focus_A01_t01: Skip # Times out
-LibTest/html/IFrameElement/onMouseWheel_A01_t01: Skip # Times out
-LibTest/html/IFrameElement/onTransitionEnd_A01_t01: Skip # Times out
LibTest/io/*: SkipByDesign # dart:io not supported.
LibTest/isolate/*: SkipByDesign # dart:isolate not supported.
LibTest/mirrors/*: SkipByDesign # dart:mirrors is not supported
diff --git a/tools/VERSION b/tools/VERSION
index f534ec5..2a1170e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -25,7 +25,7 @@
#
CHANNEL dev
MAJOR 2
-MINOR 10
+MINOR 11
PATCH 0
-PRERELEASE 152
+PRERELEASE 153
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/experimental_features.yaml b/tools/experimental_features.yaml
index e6043be..8446bb3 100644
--- a/tools/experimental_features.yaml
+++ b/tools/experimental_features.yaml
@@ -93,7 +93,7 @@
# default 'language' "category" with code generated for both CFE and Analyzer,
# while other categories can be tailored more specifically.
-current-version: '2.10.0'
+current-version: '2.11.0'
features:
non-nullable: