Version 2.10.0-108.0.dev
Merge commit '69b194e88f99e85a653d7b71e4883adda72c7c5c' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
index 3cd5e84..afd418a 100644
--- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
@@ -1515,6 +1515,33 @@
r"""Try to have all constructors eventually redirect to a non-redirecting constructor.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<Message Function(String name)>
+ templateConstructorInitializeSameInstanceVariableSeveralTimes =
+ const Template<Message Function(String name)>(
+ messageTemplate:
+ r"""'#name' was already initialized by this constructor.""",
+ withArguments:
+ _withArgumentsConstructorInitializeSameInstanceVariableSeveralTimes);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name)>
+ codeConstructorInitializeSameInstanceVariableSeveralTimes =
+ const Code<Message Function(String name)>(
+ "ConstructorInitializeSameInstanceVariableSeveralTimes",
+ templateConstructorInitializeSameInstanceVariableSeveralTimes,
+ analyzerCodes: <String>["FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS"]);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsConstructorInitializeSameInstanceVariableSeveralTimes(
+ String name) {
+ if (name.isEmpty) throw 'No name provided';
+ name = demangleMixinApplicationName(name);
+ return new Message(codeConstructorInitializeSameInstanceVariableSeveralTimes,
+ message: """'${name}' was already initialized by this constructor.""",
+ arguments: {'name': name});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(String name)> templateConstructorNotFound =
const Template<Message Function(String name)>(
messageTemplate: r"""Couldn't find constructor '#name'.""",
@@ -3728,6 +3755,60 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(
+ String
+ name)> templateFieldAlreadyInitializedAtDeclaration = const Template<
+ Message Function(String name)>(
+ messageTemplate:
+ r"""'#name' is a final instance variable that was initialized at the declaration.""",
+ withArguments: _withArgumentsFieldAlreadyInitializedAtDeclaration);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name)>
+ codeFieldAlreadyInitializedAtDeclaration =
+ const Code<Message Function(String name)>(
+ "FieldAlreadyInitializedAtDeclaration",
+ templateFieldAlreadyInitializedAtDeclaration,
+ analyzerCodes: <String>[
+ "FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION"
+ ]);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsFieldAlreadyInitializedAtDeclaration(String name) {
+ if (name.isEmpty) throw 'No name provided';
+ name = demangleMixinApplicationName(name);
+ return new Message(codeFieldAlreadyInitializedAtDeclaration,
+ message:
+ """'${name}' is a final instance variable that was initialized at the declaration.""",
+ arguments: {'name': name});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<Message Function(String name)>
+ templateFieldAlreadyInitializedAtDeclarationCause =
+ const Template<Message Function(String name)>(
+ messageTemplate: r"""'#name' was initialized here.""",
+ withArguments: _withArgumentsFieldAlreadyInitializedAtDeclarationCause);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name)>
+ codeFieldAlreadyInitializedAtDeclarationCause =
+ const Code<Message Function(String name)>(
+ "FieldAlreadyInitializedAtDeclarationCause",
+ templateFieldAlreadyInitializedAtDeclarationCause,
+ severity: Severity.context);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsFieldAlreadyInitializedAtDeclarationCause(String name) {
+ if (name.isEmpty) throw 'No name provided';
+ name = demangleMixinApplicationName(name);
+ return new Message(codeFieldAlreadyInitializedAtDeclarationCause,
+ message: """'${name}' was initialized here.""",
+ arguments: {'name': name});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeFieldInitializedOutsideDeclaringClass =
messageFieldInitializedOutsideDeclaringClass;
@@ -3871,58 +3952,6 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Template<Message Function(String name)>
- templateFinalInstanceVariableAlreadyInitialized =
- const Template<Message Function(String name)>(
- messageTemplate:
- r"""'#name' is a final instance variable that has already been initialized.""",
- withArguments: _withArgumentsFinalInstanceVariableAlreadyInitialized);
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Message Function(String name)>
- codeFinalInstanceVariableAlreadyInitialized =
- const Code<Message Function(String name)>(
- "FinalInstanceVariableAlreadyInitialized",
- templateFinalInstanceVariableAlreadyInitialized,
- analyzerCodes: <String>["FINAL_INITIALIZED_MULTIPLE_TIMES"]);
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsFinalInstanceVariableAlreadyInitialized(String name) {
- if (name.isEmpty) throw 'No name provided';
- name = demangleMixinApplicationName(name);
- return new Message(codeFinalInstanceVariableAlreadyInitialized,
- message:
- """'${name}' is a final instance variable that has already been initialized.""",
- arguments: {'name': name});
-}
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Template<Message Function(String name)>
- templateFinalInstanceVariableAlreadyInitializedCause =
- const Template<Message Function(String name)>(
- messageTemplate: r"""'#name' was initialized here.""",
- withArguments:
- _withArgumentsFinalInstanceVariableAlreadyInitializedCause);
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Message Function(String name)>
- codeFinalInstanceVariableAlreadyInitializedCause =
- const Code<Message Function(String name)>(
- "FinalInstanceVariableAlreadyInitializedCause",
- templateFinalInstanceVariableAlreadyInitializedCause,
- severity: Severity.context);
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsFinalInstanceVariableAlreadyInitializedCause(
- String name) {
- if (name.isEmpty) throw 'No name provided';
- name = demangleMixinApplicationName(name);
- return new Message(codeFinalInstanceVariableAlreadyInitializedCause,
- message: """'${name}' was initialized here.""",
- arguments: {'name': name});
-}
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeForInLoopExactlyOneVariable =
messageForInLoopExactlyOneVariable;
@@ -6128,14 +6157,14 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Null> codeMoreThanOneSuperOrThisInitializer =
- messageMoreThanOneSuperOrThisInitializer;
+const Code<Null> codeMoreThanOneSuperInitializer =
+ messageMoreThanOneSuperInitializer;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const MessageCode messageMoreThanOneSuperOrThisInitializer = const MessageCode(
- "MoreThanOneSuperOrThisInitializer",
- analyzerCodes: <String>["SUPER_IN_REDIRECTING_CONSTRUCTOR"],
- message: r"""Can't have more than one 'super' or 'this' initializer.""");
+const MessageCode messageMoreThanOneSuperInitializer = const MessageCode(
+ "MoreThanOneSuperInitializer",
+ analyzerCodes: <String>["MULTIPLE_SUPER_INITIALIZERS"],
+ message: r"""Can't have more than one 'super' initializer.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeMultipleExtends = messageMultipleExtends;
@@ -6802,6 +6831,15 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeNullableSpreadError = messageNullableSpreadError;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageNullableSpreadError = const MessageCode(
+ "NullableSpreadError",
+ message:
+ r"""An expression whose value can be 'null' must be null-checked before it can be dereferenced.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(String name)> templateNullableSuperclassError =
const Template<Message Function(String name)>(
messageTemplate:
@@ -7606,6 +7644,17 @@
message: r"""An optional named parameter can't start with '_'.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeRedirectingConstructorWithAnotherInitializer =
+ messageRedirectingConstructorWithAnotherInitializer;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageRedirectingConstructorWithAnotherInitializer =
+ const MessageCode("RedirectingConstructorWithAnotherInitializer",
+ analyzerCodes: <String>["FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR"],
+ message:
+ r"""A redirecting constructor can't have other initializers.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeRedirectingConstructorWithBody =
messageRedirectingConstructorWithBody;
@@ -7618,6 +7667,29 @@
r"""Try removing the body, or not making this a redirecting constructor.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeRedirectingConstructorWithMultipleRedirectInitializers =
+ messageRedirectingConstructorWithMultipleRedirectInitializers;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode
+ messageRedirectingConstructorWithMultipleRedirectInitializers =
+ const MessageCode("RedirectingConstructorWithMultipleRedirectInitializers",
+ analyzerCodes: <String>["MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS"],
+ message:
+ r"""A redirecting constructor can't have more than one redirection.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeRedirectingConstructorWithSuperInitializer =
+ messageRedirectingConstructorWithSuperInitializer;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageRedirectingConstructorWithSuperInitializer =
+ const MessageCode("RedirectingConstructorWithSuperInitializer",
+ analyzerCodes: <String>["SUPER_IN_REDIRECTING_CONSTRUCTOR"],
+ message:
+ r"""A redirecting constructor can't have a 'super' initializer.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeRedirectionInNonFactory = messageRedirectionInNonFactory;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -8413,15 +8485,6 @@
message: r"""Expected identifier, but got 'this'.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Null> codeThisInitializerNotAlone = messageThisInitializerNotAlone;
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const MessageCode messageThisInitializerNotAlone = const MessageCode(
- "ThisInitializerNotAlone",
- analyzerCodes: <String>["FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR"],
- message: r"""Can't have other initializers together with 'this'.""");
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(String string)>
templateThisOrSuperAccessInFieldInitializer =
const Template<Message Function(String string)>(
diff --git a/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart b/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart
index ad746d7..8cec3c9 100644
--- a/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart
@@ -24,9 +24,11 @@
import '../messages.dart'
show
Message,
- messageMoreThanOneSuperOrThisInitializer,
+ messageMoreThanOneSuperInitializer,
+ messageRedirectingConstructorWithAnotherInitializer,
+ messageRedirectingConstructorWithMultipleRedirectInitializers,
+ messageRedirectingConstructorWithSuperInitializer,
messageSuperInitializerNotLast,
- messageThisInitializerNotAlone,
noLength;
import '../source/source_library_builder.dart' show SourceLibraryBuilder;
@@ -68,8 +70,8 @@
/// The [Constructor] built by this builder.
Constructor get constructor;
- void injectInvalidInitializer(
- Message message, int charOffset, ExpressionGeneratorHelper helper);
+ void injectInvalidInitializer(Message message, int charOffset, int length,
+ ExpressionGeneratorHelper helper);
void addInitializer(
Initializer initializer, ExpressionGeneratorHelper helper);
@@ -273,14 +275,14 @@
Member get member => constructor;
@override
- void injectInvalidInitializer(
- Message message, int charOffset, ExpressionGeneratorHelper helper) {
+ void injectInvalidInitializer(Message message, int charOffset, int length,
+ ExpressionGeneratorHelper helper) {
List<Initializer> initializers = _constructor.initializers;
Initializer lastInitializer = initializers.removeLast();
assert(lastInitializer == superInitializer ||
lastInitializer == redirectingInitializer);
Initializer error = helper.buildInvalidInitializer(
- helper.buildProblem(message, charOffset, noLength));
+ helper.buildProblem(message, charOffset, length));
initializers.add(error..parent = _constructor);
initializers.add(lastInitializer);
}
@@ -290,32 +292,64 @@
Initializer initializer, ExpressionGeneratorHelper helper) {
List<Initializer> initializers = _constructor.initializers;
if (initializer is SuperInitializer) {
- if (superInitializer != null || redirectingInitializer != null) {
- injectInvalidInitializer(messageMoreThanOneSuperOrThisInitializer,
- initializer.fileOffset, helper);
+ if (superInitializer != null) {
+ injectInvalidInitializer(messageMoreThanOneSuperInitializer,
+ initializer.fileOffset, "super".length, helper);
+ } else if (redirectingInitializer != null) {
+ injectInvalidInitializer(
+ messageRedirectingConstructorWithSuperInitializer,
+ initializer.fileOffset,
+ "super".length,
+ helper);
} else {
initializers.add(initializer..parent = _constructor);
superInitializer = initializer;
}
} else if (initializer is RedirectingInitializer) {
- if (superInitializer != null || redirectingInitializer != null) {
- injectInvalidInitializer(messageMoreThanOneSuperOrThisInitializer,
- initializer.fileOffset, helper);
- } else if (_constructor.initializers.isNotEmpty) {
- Initializer first = _constructor.initializers.first;
- Initializer error = helper.buildInvalidInitializer(helper.buildProblem(
- messageThisInitializerNotAlone, first.fileOffset, noLength));
- initializers.add(error..parent = _constructor);
+ if (superInitializer != null) {
+ // Point to the existing super initializer.
+ injectInvalidInitializer(
+ messageRedirectingConstructorWithSuperInitializer,
+ superInitializer.fileOffset,
+ "super".length,
+ helper);
+ } else if (redirectingInitializer != null) {
+ injectInvalidInitializer(
+ messageRedirectingConstructorWithMultipleRedirectInitializers,
+ initializer.fileOffset,
+ noLength,
+ helper);
+ } else if (initializers.isNotEmpty) {
+ // Error on all previous ones.
+ for (int i = 0; i < initializers.length; i++) {
+ Initializer initializer = initializers[i];
+ int length = noLength;
+ if (initializer is AssertInitializer) length = "assert".length;
+ Initializer error = helper.buildInvalidInitializer(
+ helper.buildProblem(
+ messageRedirectingConstructorWithAnotherInitializer,
+ initializer.fileOffset,
+ length));
+ error.parent = _constructor;
+ initializers[i] = error;
+ }
+ initializers.add(initializer..parent = _constructor);
+ redirectingInitializer = initializer;
} else {
initializers.add(initializer..parent = _constructor);
redirectingInitializer = initializer;
}
} else if (redirectingInitializer != null) {
+ int length = noLength;
+ if (initializer is AssertInitializer) length = "assert".length;
injectInvalidInitializer(
- messageThisInitializerNotAlone, initializer.fileOffset, helper);
+ messageRedirectingConstructorWithAnotherInitializer,
+ initializer.fileOffset,
+ length,
+ helper);
} else if (superInitializer != null) {
- injectInvalidInitializer(
- messageSuperInitializerNotLast, superInitializer.fileOffset, helper);
+ injectInvalidInitializer(messageSuperInitializerNotLast,
+ initializer.fileOffset, noLength, helper);
} else {
initializers.add(initializer..parent = _constructor);
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 8558d1f..f643d50 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -3048,7 +3048,11 @@
// set or map in some situations, consider always deferring determination
// until the type resolution phase.
final int typeArgCount = typeArguments?.length;
- bool isSet = typeArgCount == 1 ? true : typeArgCount != null ? false : null;
+ bool isSet = typeArgCount == 1
+ ? true
+ : typeArgCount != null
+ ? false
+ : null;
for (int i = 0; i < setOrMapEntries.length; ++i) {
if (setOrMapEntries[i] is! MapEntry &&
@@ -5852,7 +5856,7 @@
field,
value,
new VariableDeclaration.forValue(buildProblem(
- fasta.templateFinalInstanceVariableAlreadyInitialized
+ fasta.templateConstructorInitializeSameInstanceVariableSeveralTimes
.withArguments(name),
offset,
noLength)))
@@ -5907,12 +5911,12 @@
];
} else if (builder.isFinal && builder.hasInitializer) {
addProblem(
- fasta.templateFinalInstanceVariableAlreadyInitialized
+ fasta.templateFieldAlreadyInitializedAtDeclaration
.withArguments(name),
assignmentOffset,
noLength,
context: [
- fasta.templateFinalInstanceVariableAlreadyInitializedCause
+ fasta.templateFieldAlreadyInitializedAtDeclarationCause
.withArguments(name)
.withLocation(uri, builder.charOffset, name.length)
]);
diff --git a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
index 0046492..29e6bd3 100644
--- a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
@@ -523,6 +523,10 @@
for (int i = 0; i < nodes2.length; i++) {
ClassHierarchyNode node = nodes2[i];
if (node == null) continue;
+ if (node.classBuilder.cls.isAnonymousMixin) {
+ // Never find unnamed mixin application in least upper bound.
+ continue;
+ }
if (nodes1.contains(node)) {
DartType candidate1 = getTypeAsInstanceOf(
type1, node.classBuilder.cls, clientLibrary, coreTypes);
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 ec7bc61..7560e5b 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -1328,19 +1328,19 @@
return const StatementInferenceResult();
}
- DartType getSpreadElementType(DartType spreadType, bool isNullAware) {
- DartType typeBound = inferrer.resolveTypeParameter(spreadType);
- if (inferrer.coreTypes.isNull(typeBound)) {
+ DartType getSpreadElementType(
+ DartType spreadType, DartType spreadTypeBound, bool isNullAware) {
+ if (inferrer.coreTypes.isNull(spreadTypeBound)) {
if (inferrer.isNonNullableByDefault) {
return isNullAware ? const NeverType(Nullability.nonNullable) : null;
} else {
return isNullAware ? inferrer.coreTypes.nullType : null;
}
}
- if (typeBound is InterfaceType) {
+ if (spreadTypeBound is InterfaceType) {
List<DartType> supertypeArguments = inferrer.typeSchemaEnvironment
.getTypeArgumentsAsInstanceOf(
- typeBound, inferrer.coreTypes.iterableClass);
+ spreadTypeBound, inferrer.coreTypes.iterableClass);
if (supertypeArguments == null) {
return null;
}
@@ -1377,9 +1377,10 @@
DartType spreadType = spreadResult.inferredType;
inferredSpreadTypes[element.expression] = spreadType;
Expression replacement = element;
+ DartType spreadTypeBound = inferrer.resolveTypeParameter(spreadType);
+ DartType spreadElementType = getSpreadElementType(
+ spreadType, spreadTypeBound, element.isNullAware);
if (typeChecksNeeded) {
- DartType spreadElementType =
- getSpreadElementType(spreadType, element.isNullAware);
if (spreadElementType == null) {
if (inferrer.coreTypes
.isNull(inferrer.resolveTypeParameter(spreadType)) &&
@@ -1396,7 +1397,7 @@
element.expression.fileOffset,
1);
}
- } else if (spreadType is InterfaceType) {
+ } else if (spreadTypeBound is InterfaceType) {
if (!inferrer.isAssignable(inferredTypeArgument, spreadElementType)) {
replacement = inferrer.helper.buildProblem(
templateSpreadElementTypeMismatch.withArguments(
@@ -1405,13 +1406,18 @@
inferrer.isNonNullableByDefault),
element.expression.fileOffset,
1);
+ } else if (inferrer.isNonNullableByDefault &&
+ spreadType.isPotentiallyNullable &&
+ spreadType is! DynamicType &&
+ spreadType != inferrer.coreTypes.nullType &&
+ !element.isNullAware) {
+ replacement = inferrer.helper.buildProblem(
+ messageNullableSpreadError, element.expression.fileOffset, 1);
}
}
}
// Use 'dynamic' for error recovery.
- element.elementType =
- getSpreadElementType(spreadType, element.isNullAware) ??
- const DynamicType();
+ element.elementType = spreadElementType ?? const DynamicType();
return new ExpressionInferenceResult(element.elementType, replacement);
} else if (element is IfElement) {
DartType boolType =
@@ -1802,8 +1808,9 @@
spreadType, entry.isNullAware, actualTypes, length);
DartType actualKeyType = actualTypes[length];
DartType actualValueType = actualTypes[length + 1];
+ DartType spreadTypeBound = inferrer.resolveTypeParameter(spreadType);
DartType actualElementType =
- getSpreadElementType(spreadType, entry.isNullAware);
+ getSpreadElementType(spreadType, spreadTypeBound, entry.isNullAware);
MapEntry replacement = entry;
if (typeChecksNeeded) {
@@ -1833,7 +1840,7 @@
new NullLiteral())
..fileOffset = entry.fileOffset;
}
- } else if (spreadType is InterfaceType) {
+ } else if (spreadTypeBound is InterfaceType) {
Expression keyError;
Expression valueError;
if (!inferrer.isAssignable(inferredKeyType, actualKeyType)) {
@@ -1854,6 +1861,14 @@
entry.expression.fileOffset,
1);
}
+ if (inferrer.isNonNullableByDefault &&
+ spreadType.isPotentiallyNullable &&
+ spreadType is! DynamicType &&
+ spreadType != inferrer.coreTypes.nullType &&
+ !entry.isNullAware) {
+ keyError = inferrer.helper.buildProblem(
+ messageNullableSpreadError, entry.expression.fileOffset, 1);
+ }
if (keyError != null || valueError != null) {
keyError ??= new NullLiteral();
valueError ??= new NullLiteral();
@@ -2331,9 +2346,12 @@
return new ExpressionInferenceResult(inferredType, setLiteral);
}
if (canBeSet && canBeMap && node.entries.isNotEmpty) {
- Expression error = inferrer.helper.buildProblem(
- messageCantDisambiguateNotEnoughInformation, node.fileOffset, 1);
- return new ExpressionInferenceResult(const BottomType(), error);
+ Expression replacement = node;
+ if (!inferrer.isTopLevel) {
+ replacement = inferrer.helper.buildProblem(
+ messageCantDisambiguateNotEnoughInformation, node.fileOffset, 1);
+ }
+ return new ExpressionInferenceResult(const BottomType(), replacement);
}
if (!canBeSet && !canBeMap) {
Expression replacement = node;
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index cbf22b3..3844240 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -334,7 +334,6 @@
FinalAndCovariant/part_wrapped_script2: Fail
FinalAndCovariant/script2: Fail
FinalFieldWithoutInitializer/example: Fail
-FinalInstanceVariableAlreadyInitialized/example: Fail
ForInLoopElementTypeNotAssignable/example: Fail
ForInLoopExactlyOneVariable/analyzerCode: Fail # The analyzer doesn't recover well.
ForInLoopExactlyOneVariable/part_wrapped_statement: Fail
@@ -550,6 +549,8 @@
NullablePropertyAccessError/example: Fail
NullablePropertyAccessWarning/analyzerCode: Fail
NullablePropertyAccessWarning/example: Fail
+NullableSpreadError/analyzerCode: Fail
+NullableSpreadError/example: Fail
NullableSuperclassError/analyzerCode: Fail
NullableSuperclassError/example: Fail
NullableSuperclassWarning/analyzerCode: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index b3ccbbe..d568f05 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -832,21 +832,34 @@
template: "'#name' isn't an instance field of this class."
analyzerCode: INITIALIZER_FOR_STATIC_FIELD
-MoreThanOneSuperOrThisInitializer:
- template: "Can't have more than one 'super' or 'this' initializer."
- analyzerCode: SUPER_IN_REDIRECTING_CONSTRUCTOR
+MoreThanOneSuperInitializer:
+ template: "Can't have more than one 'super' initializer."
+ analyzerCode: MULTIPLE_SUPER_INITIALIZERS
script:
- "class C { C.bad() : super(), super(); }"
+
+RedirectingConstructorWithSuperInitializer:
+ template: "A redirecting constructor can't have a 'super' initializer."
+ analyzerCode: SUPER_IN_REDIRECTING_CONSTRUCTOR
+ script:
- "class C { C(); C.bad() : super(), this(); }"
- "class C { C(); C.bad() : this(), super(); }"
+
+RedirectingConstructorWithMultipleRedirectInitializers:
+ template: "A redirecting constructor can't have more than one redirection."
+ analyzerCode: MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS
+ script:
- "class C { C(); C.bad() : this(), this(); }"
-ThisInitializerNotAlone:
- template: "Can't have other initializers together with 'this'."
+RedirectingConstructorWithAnotherInitializer:
+ template: "A redirecting constructor can't have other initializers."
+ # also ASSERT_IN_REDIRECTING_CONSTRUCTOR
analyzerCode: FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
script:
- "class C { int x; C(); C.bad() : x = 5, this(); }"
- "class C { int x; C(); C.bad() : this(), x = 5; }"
+ - "class C { int x; C(); C.bad() : assert(true), this(); }"
+ - "class C { int x; C(); C.bad() : this(), assert(true); }"
SuperInitializerNotLast:
template: "Can't have initializers after 'super'."
@@ -2801,17 +2814,23 @@
template: "Switch case may fall through to the next case."
analyzerCode: CASE_BLOCK_NOT_TERMINATED
-FinalInstanceVariableAlreadyInitialized:
- template: "'#name' is a final instance variable that has already been initialized."
- # TODO(ahe): Strictly speaking, as of
- # 3b5874a332b24f326775b3520f32b9a818731aca, this is a compile-time error in
- # legacy mode.
- analyzerCode: FINAL_INITIALIZED_MULTIPLE_TIMES
+FieldAlreadyInitializedAtDeclaration:
+ template: "'#name' is a final instance variable that was initialized at the declaration."
+ analyzerCode: FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
+ script:
+ - "class C { final int x = 2; C(): this.x = 3 {} }"
-FinalInstanceVariableAlreadyInitializedCause:
+FieldAlreadyInitializedAtDeclarationCause:
template: "'#name' was initialized here."
severity: CONTEXT
+ConstructorInitializeSameInstanceVariableSeveralTimes:
+ template: "'#name' was already initialized by this constructor."
+ analyzerCode: FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
+ script:
+ - "class C { final int x; C(): this.x = 1, this.x = 2 {} }"
+ - "class C { int x; C(): this.x = 1, this.x = 2 {} }"
+
TypeVariableInStaticContext:
template: "Type variables can't be used in static members."
analyzerCode: TYPE_PARAMETER_REFERENCED_BY_STATIC
@@ -4071,6 +4090,9 @@
NullableTearoffError:
template: "Can't tear off method '#name' from a potentially null value."
+NullableSpreadError:
+ template: "An expression whose value can be 'null' must be null-checked before it can be dereferenced."
+
ThrowingNotAssignableToObjectError:
template: "Can't throw a value of '#type' since it is neither dynamic nor non-nullable."
diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt
index c9f67ed..5882a79 100644
--- a/pkg/front_end/test/spell_checking_list_common.txt
+++ b/pkg/front_end/test/spell_checking_list_common.txt
@@ -793,6 +793,7 @@
deprecated
depromotes
depth
+dereferenced
derivation
derive
derived
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index a825e87..f858baf 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -151,6 +151,7 @@
decrease
decrements
dectcem
+deduplication
defaulting
defintions
deleting
@@ -163,6 +164,7 @@
deviation
dfast
di
+diagnosticable
dictionaries
dictionary
differences
@@ -216,6 +218,7 @@
execute
exercised
exercises
+existence
exitcode
exiting
expanded
diff --git a/pkg/front_end/testcases/general/initialzation_errors.dart b/pkg/front_end/testcases/general/initialzation_errors.dart
new file mode 100644
index 0000000..0b399c2
--- /dev/null
+++ b/pkg/front_end/testcases/general/initialzation_errors.dart
@@ -0,0 +1,104 @@
+// 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 x;
+ A()
+ : this.x = 41,
+ this.x = 42 {}
+}
+
+class B {
+ final int x;
+ B()
+ : this.x = 41,
+ this.x = 42 {}
+}
+
+class C {
+ final int x = 2;
+ C()
+ : this.x = 41,
+ this.x = 42 {}
+}
+
+class D {
+ final int x;
+ final int y;
+ D()
+ : this.x = 41,
+ this.named(),
+ this.y = 42 {}
+ D.named()
+ : this.x = 41,
+ this.y = 42 {}
+}
+
+class E {
+ final int x;
+ final int y;
+ E()
+ : this.named(),
+ this.x = 1,
+ this.y = 2 {}
+ E.named()
+ : this.x = 41,
+ this.y = 42 {}
+ E.named2()
+ : this.x = 1,
+ this.named(),
+ this.y = 2;
+ E.named3()
+ : super(),
+ this.named(),
+ this.x = 1,
+ this.y = 2;
+ E.named4()
+ : this.x = 1,
+ this.y = 2,
+ this.named();
+ E.named5()
+ : assert(true),
+ this.named();
+ E.named6()
+ : this.named(),
+ assert(true);
+}
+
+class F {
+ F()
+ : this.named(),
+ super() {}
+ F.named() {}
+}
+
+class G {
+ G()
+ : super(),
+ this.named(),
+ super() {}
+ G.named() {}
+}
+
+class H {
+ H()
+ : this.named(),
+ this.named();
+ H.named() {}
+}
+
+class I {
+ I()
+ : super(),
+ super() {}
+}
+
+class J {
+ int x;
+ J()
+ : super(),
+ this.x = 42 {}
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/initialzation_errors.dart.outline.expect b/pkg/front_end/testcases/general/initialzation_errors.dart.outline.expect
new file mode 100644
index 0000000..df79178
--- /dev/null
+++ b/pkg/front_end/testcases/general/initialzation_errors.dart.outline.expect
@@ -0,0 +1,174 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int* x;
+ constructor •() → self::A*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class B extends core::Object {
+ final field core::int* x;
+ constructor •() → self::B*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class C extends core::Object {
+ final field core::int* x;
+ constructor •() → self::C*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class D extends core::Object {
+ final field core::int* x;
+ final field core::int* y;
+ constructor •() → self::D*
+ ;
+ constructor named() → self::D*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class E extends core::Object {
+ final field core::int* x;
+ final field core::int* y;
+ constructor •() → self::E*
+ ;
+ constructor named() → self::E*
+ ;
+ constructor named2() → self::E*
+ ;
+ constructor named3() → self::E*
+ ;
+ constructor named4() → self::E*
+ ;
+ constructor named5() → self::E*
+ ;
+ constructor named6() → self::E*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class F extends core::Object {
+ constructor •() → self::F*
+ ;
+ constructor named() → self::F*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class G extends core::Object {
+ constructor •() → self::G*
+ ;
+ constructor named() → self::G*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class H extends core::Object {
+ constructor •() → self::H*
+ ;
+ constructor named() → self::H*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class I extends core::Object {
+ constructor •() → self::I*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class J extends core::Object {
+ field core::int* x;
+ constructor •() → self::J*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/general/initialzation_errors.dart.strong.expect b/pkg/front_end/testcases/general/initialzation_errors.dart.strong.expect
new file mode 100644
index 0000000..fc29ac4
--- /dev/null
+++ b/pkg/front_end/testcases/general/initialzation_errors.dart.strong.expect
@@ -0,0 +1,321 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
+// this.x = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
+// this.x = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
+// : this.x = 41,
+// ^
+// pkg/front_end/testcases/general/initialzation_errors.dart:20:13: Context: 'x' was initialized here.
+// final int x = 2;
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
+// this.x = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
+// : this.x = 41,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
+// this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 2 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
+// : this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 2;
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
+// : super(),
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:55:16: Error: Can't have initializers after 'super'.
+// this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:56:16: Error: Can't have initializers after 'super'.
+// this.y = 2;
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
+// : this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 2,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
+// : assert(true),
+// ^^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:66:9: Error: A redirecting constructor can't have other initializers.
+// assert(true);
+// ^^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:72:9: Error: A redirecting constructor can't have a 'super' initializer.
+// super() {}
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:78:9: Error: A redirecting constructor can't have a 'super' initializer.
+// : super(),
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:80:9: Error: Can't have more than one 'super' initializer.
+// super() {}
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:87:14: Error: A redirecting constructor can't have more than one redirection.
+// this.named();
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:94:9: Error: Can't have more than one 'super' initializer.
+// super() {}
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:101:16: Error: Can't have initializers after 'super'.
+// this.x = 42 {}
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int* x;
+ constructor •() → self::A*
+ : self::A::x = 41, final dynamic #t1 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class B extends core::Object {
+ final field core::int* x;
+ constructor •() → self::B*
+ : self::B::x = 41, final dynamic #t2 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class C extends core::Object {
+ final field core::int* x = 2;
+ constructor •() → self::C*
+ : final dynamic #t3 = throw new core::_DuplicatedFieldInitializerError::•("x"), final dynamic #t4 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class D extends core::Object {
+ final field core::int* x;
+ final field core::int* y;
+ constructor •() → self::D*
+ : final dynamic #t5 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
+ : this.x = 41,
+ ^", final dynamic #t6 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 42 {}
+ ^", this self::D::named() {}
+ constructor named() → self::D*
+ : self::D::x = 41, self::D::y = 42, super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class E extends core::Object {
+ final field core::int* x;
+ final field core::int* y;
+ constructor •() → self::E*
+ : final dynamic #t7 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
+ this.x = 1,
+ ^", final dynamic #t8 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 2 {}
+ ^", this self::E::named() {}
+ constructor named() → self::E*
+ : self::E::x = 41, self::E::y = 42, super core::Object::•() {}
+ constructor named2() → self::E*
+ : final dynamic #t9 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
+ : this.x = 1,
+ ^", final dynamic #t10 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 2;
+ ^", this self::E::named()
+ ;
+ constructor named3() → self::E*
+ : final dynamic #t11 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
+ : super(),
+ ^^^^^", final dynamic #t12 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:55:16: Error: Can't have initializers after 'super'.
+ this.x = 1,
+ ^", final dynamic #t13 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:56:16: Error: Can't have initializers after 'super'.
+ this.y = 2;
+ ^", super core::Object::•()
+ ;
+ constructor named4() → self::E*
+ : final dynamic #t14 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
+ : this.x = 1,
+ ^", final dynamic #t15 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 2,
+ ^", this self::E::named()
+ ;
+ constructor named5() → self::E*
+ : final dynamic #t16 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
+ : assert(true),
+ ^^^^^^", this self::E::named()
+ ;
+ constructor named6() → self::E*
+ : final dynamic #t17 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:66:9: Error: A redirecting constructor can't have other initializers.
+ assert(true);
+ ^^^^^^", this self::E::named()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class F extends core::Object {
+ constructor •() → self::F*
+ : final dynamic #t18 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:72:9: Error: A redirecting constructor can't have a 'super' initializer.
+ super() {}
+ ^^^^^", this self::F::named() {}
+ constructor named() → self::F*
+ : super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class G extends core::Object {
+ constructor •() → self::G*
+ : final dynamic #t19 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:78:9: Error: A redirecting constructor can't have a 'super' initializer.
+ : super(),
+ ^^^^^", final dynamic #t20 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:80:9: Error: Can't have more than one 'super' initializer.
+ super() {}
+ ^^^^^", super core::Object::•() {}
+ constructor named() → self::G*
+ : super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class H extends core::Object {
+ constructor •() → self::H*
+ : final dynamic #t21 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:87:14: Error: A redirecting constructor can't have more than one redirection.
+ this.named();
+ ^", this self::H::named()
+ ;
+ constructor named() → self::H*
+ : super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class I extends core::Object {
+ constructor •() → self::I*
+ : final dynamic #t22 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:94:9: Error: Can't have more than one 'super' initializer.
+ super() {}
+ ^^^^^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class J extends core::Object {
+ field core::int* x;
+ constructor •() → self::J*
+ : final dynamic #t23 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:101:16: Error: Can't have initializers after 'super'.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general/initialzation_errors.dart.strong.transformed.expect b/pkg/front_end/testcases/general/initialzation_errors.dart.strong.transformed.expect
new file mode 100644
index 0000000..fc29ac4
--- /dev/null
+++ b/pkg/front_end/testcases/general/initialzation_errors.dart.strong.transformed.expect
@@ -0,0 +1,321 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
+// this.x = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
+// this.x = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:22:16: Error: 'x' is a final instance variable that was initialized at the declaration.
+// : this.x = 41,
+// ^
+// pkg/front_end/testcases/general/initialzation_errors.dart:20:13: Context: 'x' was initialized here.
+// final int x = 2;
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
+// this.x = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
+// : this.x = 41,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 42 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
+// this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 2 {}
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
+// : this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 2;
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
+// : super(),
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:55:16: Error: Can't have initializers after 'super'.
+// this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:56:16: Error: Can't have initializers after 'super'.
+// this.y = 2;
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
+// : this.x = 1,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
+// this.y = 2,
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
+// : assert(true),
+// ^^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:66:9: Error: A redirecting constructor can't have other initializers.
+// assert(true);
+// ^^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:72:9: Error: A redirecting constructor can't have a 'super' initializer.
+// super() {}
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:78:9: Error: A redirecting constructor can't have a 'super' initializer.
+// : super(),
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:80:9: Error: Can't have more than one 'super' initializer.
+// super() {}
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:87:14: Error: A redirecting constructor can't have more than one redirection.
+// this.named();
+// ^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:94:9: Error: Can't have more than one 'super' initializer.
+// super() {}
+// ^^^^^
+//
+// pkg/front_end/testcases/general/initialzation_errors.dart:101:16: Error: Can't have initializers after 'super'.
+// this.x = 42 {}
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ field core::int* x;
+ constructor •() → self::A*
+ : self::A::x = 41, final dynamic #t1 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:9:16: Error: 'x' was already initialized by this constructor.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class B extends core::Object {
+ final field core::int* x;
+ constructor •() → self::B*
+ : self::B::x = 41, final dynamic #t2 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:16:16: Error: 'x' was already initialized by this constructor.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class C extends core::Object {
+ final field core::int* x = 2;
+ constructor •() → self::C*
+ : final dynamic #t3 = throw new core::_DuplicatedFieldInitializerError::•("x"), final dynamic #t4 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:23:16: Error: 'x' was already initialized by this constructor.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class D extends core::Object {
+ final field core::int* x;
+ final field core::int* y;
+ constructor •() → self::D*
+ : final dynamic #t5 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:30:16: Error: A redirecting constructor can't have other initializers.
+ : this.x = 41,
+ ^", final dynamic #t6 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:32:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 42 {}
+ ^", this self::D::named() {}
+ constructor named() → self::D*
+ : self::D::x = 41, self::D::y = 42, super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class E extends core::Object {
+ final field core::int* x;
+ final field core::int* y;
+ constructor •() → self::E*
+ : final dynamic #t7 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:43:16: Error: A redirecting constructor can't have other initializers.
+ this.x = 1,
+ ^", final dynamic #t8 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:44:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 2 {}
+ ^", this self::E::named() {}
+ constructor named() → self::E*
+ : self::E::x = 41, self::E::y = 42, super core::Object::•() {}
+ constructor named2() → self::E*
+ : final dynamic #t9 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:49:16: Error: A redirecting constructor can't have other initializers.
+ : this.x = 1,
+ ^", final dynamic #t10 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:51:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 2;
+ ^", this self::E::named()
+ ;
+ constructor named3() → self::E*
+ : final dynamic #t11 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:53:9: Error: A redirecting constructor can't have a 'super' initializer.
+ : super(),
+ ^^^^^", final dynamic #t12 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:55:16: Error: Can't have initializers after 'super'.
+ this.x = 1,
+ ^", final dynamic #t13 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:56:16: Error: Can't have initializers after 'super'.
+ this.y = 2;
+ ^", super core::Object::•()
+ ;
+ constructor named4() → self::E*
+ : final dynamic #t14 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:58:16: Error: A redirecting constructor can't have other initializers.
+ : this.x = 1,
+ ^", final dynamic #t15 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:59:16: Error: A redirecting constructor can't have other initializers.
+ this.y = 2,
+ ^", this self::E::named()
+ ;
+ constructor named5() → self::E*
+ : final dynamic #t16 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:62:9: Error: A redirecting constructor can't have other initializers.
+ : assert(true),
+ ^^^^^^", this self::E::named()
+ ;
+ constructor named6() → self::E*
+ : final dynamic #t17 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:66:9: Error: A redirecting constructor can't have other initializers.
+ assert(true);
+ ^^^^^^", this self::E::named()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class F extends core::Object {
+ constructor •() → self::F*
+ : final dynamic #t18 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:72:9: Error: A redirecting constructor can't have a 'super' initializer.
+ super() {}
+ ^^^^^", this self::F::named() {}
+ constructor named() → self::F*
+ : super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class G extends core::Object {
+ constructor •() → self::G*
+ : final dynamic #t19 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:78:9: Error: A redirecting constructor can't have a 'super' initializer.
+ : super(),
+ ^^^^^", final dynamic #t20 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:80:9: Error: Can't have more than one 'super' initializer.
+ super() {}
+ ^^^^^", super core::Object::•() {}
+ constructor named() → self::G*
+ : super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class H extends core::Object {
+ constructor •() → self::H*
+ : final dynamic #t21 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:87:14: Error: A redirecting constructor can't have more than one redirection.
+ this.named();
+ ^", this self::H::named()
+ ;
+ constructor named() → self::H*
+ : super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class I extends core::Object {
+ constructor •() → self::I*
+ : final dynamic #t22 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:94:9: Error: Can't have more than one 'super' initializer.
+ super() {}
+ ^^^^^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class J extends core::Object {
+ field core::int* x;
+ constructor •() → self::J*
+ : final dynamic #t23 = invalid-expression "pkg/front_end/testcases/general/initialzation_errors.dart:101:16: Error: Can't have initializers after 'super'.
+ this.x = 42 {}
+ ^", super core::Object::•() {}
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/general/initialzation_errors.dart.textual_outline.expect b/pkg/front_end/testcases/general/initialzation_errors.dart.textual_outline.expect
new file mode 100644
index 0000000..f1eb7f2
--- /dev/null
+++ b/pkg/front_end/testcases/general/initialzation_errors.dart.textual_outline.expect
@@ -0,0 +1,100 @@
+class A {
+ int x;
+ A()
+ : this.x = 41,
+ this.x = 42 {}
+}
+
+class B {
+ final int x;
+ B()
+ : this.x = 41,
+ this.x = 42 {}
+}
+
+class C {
+ final int x = 2;
+ C()
+ : this.x = 41,
+ this.x = 42 {}
+}
+
+class D {
+ final int x;
+ final int y;
+ D()
+ : this.x = 41,
+ this.named(),
+ this.y = 42 {}
+ D.named()
+ : this.x = 41,
+ this.y = 42 {}
+}
+
+class E {
+ final int x;
+ final int y;
+ E()
+ : this.named(),
+ this.x = 1,
+ this.y = 2 {}
+ E.named()
+ : this.x = 41,
+ this.y = 42 {}
+ E.named2()
+ : this.x = 1,
+ this.named(),
+ this.y = 2;
+ E.named3()
+ : super(),
+ this.named(),
+ this.x = 1,
+ this.y = 2;
+ E.named4()
+ : this.x = 1,
+ this.y = 2,
+ this.named();
+ E.named5()
+ : assert(true),
+ this.named();
+ E.named6()
+ : this.named(),
+ assert(true);
+}
+
+class F {
+ F()
+ : this.named(),
+ super() {}
+ F.named() {}
+}
+
+class G {
+ G()
+ : super(),
+ this.named(),
+ super() {}
+ G.named() {}
+}
+
+class H {
+ H()
+ : this.named(),
+ this.named();
+ H.named() {}
+}
+
+class I {
+ I()
+ : super(),
+ super() {}
+}
+
+class J {
+ int x;
+ J()
+ : super(),
+ this.x = 42 {}
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/initialzation_errors.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/initialzation_errors.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..f09d803
--- /dev/null
+++ b/pkg/front_end/testcases/general/initialzation_errors.dart.textual_outline_modelled.expect
@@ -0,0 +1,100 @@
+class A {
+ A()
+ : this.x = 41,
+ this.x = 42 {}
+ int x;
+}
+
+class B {
+ B()
+ : this.x = 41,
+ this.x = 42 {}
+ final int x;
+}
+
+class C {
+ C()
+ : this.x = 41,
+ this.x = 42 {}
+ final int x = 2;
+}
+
+class D {
+ D()
+ : this.x = 41,
+ this.named(),
+ this.y = 42 {}
+ D.named()
+ : this.x = 41,
+ this.y = 42 {}
+ final int x;
+ final int y;
+}
+
+class E {
+ E()
+ : this.named(),
+ this.x = 1,
+ this.y = 2 {}
+ E.named()
+ : this.x = 41,
+ this.y = 42 {}
+ E.named2()
+ : this.x = 1,
+ this.named(),
+ this.y = 2;
+ E.named3()
+ : super(),
+ this.named(),
+ this.x = 1,
+ this.y = 2;
+ E.named4()
+ : this.x = 1,
+ this.y = 2,
+ this.named();
+ E.named5()
+ : assert(true),
+ this.named();
+ E.named6()
+ : this.named(),
+ assert(true);
+ final int x;
+ final int y;
+}
+
+class F {
+ F()
+ : this.named(),
+ super() {}
+ F.named() {}
+}
+
+class G {
+ G()
+ : super(),
+ this.named(),
+ super() {}
+ G.named() {}
+}
+
+class H {
+ H()
+ : this.named(),
+ this.named();
+ H.named() {}
+}
+
+class I {
+ I()
+ : super(),
+ super() {}
+}
+
+class J {
+ J()
+ : super(),
+ this.x = 42 {}
+ int x;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/general/many_errors.dart.outline.expect b/pkg/front_end/testcases/general/many_errors.dart.outline.expect
index 0493c42..623c813 100644
--- a/pkg/front_end/testcases/general/many_errors.dart.outline.expect
+++ b/pkg/front_end/testcases/general/many_errors.dart.outline.expect
@@ -15,7 +15,7 @@
// const A.named2() : x = new Object();
// ^^^
//
-// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that has already been initialized.
+// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
// const A.named2() : x = new Object();
// ^
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
diff --git a/pkg/front_end/testcases/general/many_errors.dart.strong.expect b/pkg/front_end/testcases/general/many_errors.dart.strong.expect
index 5dcbf8b..c04f498 100644
--- a/pkg/front_end/testcases/general/many_errors.dart.strong.expect
+++ b/pkg/front_end/testcases/general/many_errors.dart.strong.expect
@@ -15,7 +15,7 @@
// const A.named2() : x = new Object();
// ^^^
//
-// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that has already been initialized.
+// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
// const A.named2() : x = new Object();
// ^
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
diff --git a/pkg/front_end/testcases/general/many_errors.dart.strong.transformed.expect b/pkg/front_end/testcases/general/many_errors.dart.strong.transformed.expect
index 5dcbf8b..c04f498 100644
--- a/pkg/front_end/testcases/general/many_errors.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/many_errors.dart.strong.transformed.expect
@@ -15,7 +15,7 @@
// const A.named2() : x = new Object();
// ^^^
//
-// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that has already been initialized.
+// pkg/front_end/testcases/general/many_errors.dart:10:24: Error: 'x' is a final instance variable that was initialized at the declaration.
// const A.named2() : x = new Object();
// ^
// pkg/front_end/testcases/general/many_errors.dart:6:9: Context: 'x' was initialized here.
diff --git a/pkg/front_end/testcases/general/mixin_application_lub.dart b/pkg/front_end/testcases/general/mixin_application_lub.dart
new file mode 100644
index 0000000..a144b92
--- /dev/null
+++ b/pkg/front_end/testcases/general/mixin_application_lub.dart
@@ -0,0 +1,31 @@
+// 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 Diagnosticable {}
+
+// Originally the existence of this (unused) class (which has an anonymous mixin
+// that matches that of `State<T>`) caused an error in the VM's mixin
+// deduplication code. This was due to the inferred type for `var x = a ?? b`
+// was the anonymous mixin application that got removed during deduplication.
+//
+// See https://github.com/flutter/flutter/issues/55345
+class SomeClass with Diagnosticable {}
+
+class State<T> with Diagnosticable {}
+
+class StateA extends State {}
+
+class StateB extends State<int> {}
+
+StateA a = StateA();
+StateB b = StateB();
+
+foo<T>(T x) {
+ print(T);
+}
+
+main() {
+ var x = a ?? b;
+ foo(x);
+}
diff --git a/pkg/front_end/testcases/general/mixin_application_lub.dart.outline.expect b/pkg/front_end/testcases/general/mixin_application_lub.dart.outline.expect
new file mode 100644
index 0000000..cf58674
--- /dev/null
+++ b/pkg/front_end/testcases/general/mixin_application_lub.dart.outline.expect
@@ -0,0 +1,70 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Diagnosticable extends core::Object {
+ synthetic constructor •() → self::Diagnosticable*
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+abstract class _SomeClass&Object&Diagnosticable = core::Object with self::Diagnosticable /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_SomeClass&Object&Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class SomeClass extends self::_SomeClass&Object&Diagnosticable {
+ synthetic constructor •() → self::SomeClass*
+ ;
+}
+abstract class _State&Object&Diagnosticable = core::Object with self::Diagnosticable /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_State&Object&Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class State<T extends core::Object* = dynamic> extends self::_State&Object&Diagnosticable {
+ synthetic constructor •() → self::State<self::State::T*>*
+ ;
+}
+class StateA extends self::State<dynamic> {
+ synthetic constructor •() → self::StateA*
+ ;
+}
+class StateB extends self::State<core::int*> {
+ synthetic constructor •() → self::StateB*
+ ;
+}
+static field self::StateA* a;
+static field self::StateB* b;
+static method foo<T extends core::Object* = dynamic>(self::foo::T* x) → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/general/mixin_application_lub.dart.strong.expect b/pkg/front_end/testcases/general/mixin_application_lub.dart.strong.expect
new file mode 100644
index 0000000..e277693
--- /dev/null
+++ b/pkg/front_end/testcases/general/mixin_application_lub.dart.strong.expect
@@ -0,0 +1,78 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Diagnosticable extends core::Object {
+ synthetic constructor •() → self::Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+abstract class _SomeClass&Object&Diagnosticable = core::Object with self::Diagnosticable /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_SomeClass&Object&Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class SomeClass extends self::_SomeClass&Object&Diagnosticable {
+ synthetic constructor •() → self::SomeClass*
+ : super self::_SomeClass&Object&Diagnosticable::•()
+ ;
+}
+abstract class _State&Object&Diagnosticable = core::Object with self::Diagnosticable /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_State&Object&Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class State<T extends core::Object* = dynamic> extends self::_State&Object&Diagnosticable {
+ synthetic constructor •() → self::State<self::State::T*>*
+ : super self::_State&Object&Diagnosticable::•()
+ ;
+}
+class StateA extends self::State<dynamic> {
+ synthetic constructor •() → self::StateA*
+ : super self::State::•()
+ ;
+}
+class StateB extends self::State<core::int*> {
+ synthetic constructor •() → self::StateB*
+ : super self::State::•()
+ ;
+}
+static field self::StateA* a = new self::StateA::•();
+static field self::StateB* b = new self::StateB::•();
+static method foo<T extends core::Object* = dynamic>(self::foo::T* x) → dynamic {
+ core::print(self::foo::T*);
+}
+static method main() → dynamic {
+ self::Diagnosticable* x = let final self::StateA* #t1 = self::a in #t1.{self::_State&Object&Diagnosticable::==}(null) ?{self::Diagnosticable*} self::b : #t1;
+ self::foo<self::Diagnosticable*>(x);
+}
diff --git a/pkg/front_end/testcases/general/mixin_application_lub.dart.strong.transformed.expect b/pkg/front_end/testcases/general/mixin_application_lub.dart.strong.transformed.expect
new file mode 100644
index 0000000..421798b
--- /dev/null
+++ b/pkg/front_end/testcases/general/mixin_application_lub.dart.strong.transformed.expect
@@ -0,0 +1,78 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class Diagnosticable extends core::Object {
+ synthetic constructor •() → self::Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+abstract class _SomeClass&Object&Diagnosticable extends core::Object implements self::Diagnosticable /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_SomeClass&Object&Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class SomeClass extends self::_SomeClass&Object&Diagnosticable {
+ synthetic constructor •() → self::SomeClass*
+ : super self::_SomeClass&Object&Diagnosticable::•()
+ ;
+}
+abstract class _State&Object&Diagnosticable extends core::Object implements self::Diagnosticable /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_State&Object&Diagnosticable*
+ : super core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::==
+ abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode
+ abstract member-signature method toString() → core::String*; -> core::Object::toString
+ abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType
+}
+class State<T extends core::Object* = dynamic> extends self::_State&Object&Diagnosticable {
+ synthetic constructor •() → self::State<self::State::T*>*
+ : super self::_State&Object&Diagnosticable::•()
+ ;
+}
+class StateA extends self::State<dynamic> {
+ synthetic constructor •() → self::StateA*
+ : super self::State::•()
+ ;
+}
+class StateB extends self::State<core::int*> {
+ synthetic constructor •() → self::StateB*
+ : super self::State::•()
+ ;
+}
+static field self::StateA* a = new self::StateA::•();
+static field self::StateB* b = new self::StateB::•();
+static method foo<T extends core::Object* = dynamic>(self::foo::T* x) → dynamic {
+ core::print(self::foo::T*);
+}
+static method main() → dynamic {
+ self::Diagnosticable* x = let final self::StateA* #t1 = self::a in #t1.{self::_State&Object&Diagnosticable::==}(null) ?{self::Diagnosticable*} self::b : #t1;
+ self::foo<self::Diagnosticable*>(x);
+}
diff --git a/pkg/front_end/testcases/general/mixin_application_lub.dart.textual_outline.expect b/pkg/front_end/testcases/general/mixin_application_lub.dart.textual_outline.expect
new file mode 100644
index 0000000..5603659
--- /dev/null
+++ b/pkg/front_end/testcases/general/mixin_application_lub.dart.textual_outline.expect
@@ -0,0 +1,14 @@
+class Diagnosticable {}
+
+class SomeClass with Diagnosticable {}
+
+class State<T> with Diagnosticable {}
+
+class StateA extends State {}
+
+class StateB extends State<int> {}
+
+StateA a = StateA();
+StateB b = StateB();
+foo<T>(T x) {}
+main() {}
diff --git a/pkg/front_end/testcases/general/mixin_application_lub.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/mixin_application_lub.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..0d56a51
--- /dev/null
+++ b/pkg/front_end/testcases/general/mixin_application_lub.dart.textual_outline_modelled.expect
@@ -0,0 +1,15 @@
+StateA a = StateA();
+StateB b = StateB();
+
+class Diagnosticable {}
+
+class SomeClass with Diagnosticable {}
+
+class State<T> with Diagnosticable {}
+
+class StateA extends State {}
+
+class StateB extends State<int> {}
+
+foo<T>(T x) {}
+main() {}
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.expect b/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.expect
index b3f3142..c4c2ced 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.expect
@@ -15,7 +15,7 @@
// const A.named2() : x = new Object();
// ^^^
//
-// pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart:12:24: Error: 'x' is a final instance variable that has already been initialized.
+// pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
// const A.named2() : x = new Object();
// ^
// pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart:8:9: Context: 'x' was initialized here.
diff --git a/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.transformed.expect b/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.transformed.expect
index b3f3142..c4c2ced 100644
--- a/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart.weak.transformed.expect
@@ -15,7 +15,7 @@
// const A.named2() : x = new Object();
// ^^^
//
-// pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart:12:24: Error: 'x' is a final instance variable that has already been initialized.
+// pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart:12:24: Error: 'x' is a final instance variable that was initialized at the declaration.
// const A.named2() : x = new Object();
// ^
// pkg/front_end/testcases/general_nnbd_opt_out/many_errors.dart:8:9: Context: 'x' was initialized here.
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml
new file mode 100644
index 0000000..c049a7d
--- /dev/null
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml
@@ -0,0 +1,38 @@
+# 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.md file.
+
+# Reproduction of https://github.com/dart-lang/sdk/issues/32366.
+type: newworld
+worlds:
+ - entry: main.dart
+ sources:
+ main.dart: |
+ abstract class AIterator extends Iterator {
+ }
+ class Foo {
+ final a;
+ Foo(this.a);
+ }
+ main() {
+ new Foo(5);
+ return 1;
+ }
+ expectedLibraryCount: 1
+ - entry: main.dart
+ invalidate:
+ - main.dart
+ errors: true
+ sources:
+ main.dart: |
+ abstract class BIterator extends Iterator {
+ }
+ class Foo {
+ final a kjsdf ksjdf ;
+ Foo(this.a);
+ }
+ main() {
+ new Foo(5);
+ return 2;
+ }
+ expectedLibraryCount: 1
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml.world.1.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml.world.1.expect
new file mode 100644
index 0000000..886b31c
--- /dev/null
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml.world.1.expect
@@ -0,0 +1,40 @@
+main = <No Member>;
+library from "org-dartlang-test:///main.dart" as main {
+
+ abstract class AIterator extends dart.core::Iterator<dynamic> {
+ synthetic constructor •() → main::AIterator*
+ : super dart.core::Iterator::•()
+ ;
+ abstract member-signature method moveNext() → dart.core::bool*; -> dart.core::Iterator::moveNext
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ class Foo extends dart.core::Object {
+ final field dynamic a;
+ constructor •(dynamic a) → main::Foo*
+ : main::Foo::a = a, super dart.core::Object::•()
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ static method main() → dynamic {
+ new main::Foo::•(5);
+ return 1;
+ }
+}
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml.world.2.expect b/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml.world.2.expect
new file mode 100644
index 0000000..ef7453c
--- /dev/null
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/issue_32366.yaml.world.2.expect
@@ -0,0 +1,70 @@
+main = <No Member>;
+library from "org-dartlang-test:///main.dart" as main {
+//
+// Problems in library:
+//
+// org-dartlang-test:///main.dart:4:11: Error: Expected ';' after this.
+// final a kjsdf ksjdf ;
+// ^^^^^
+//
+// org-dartlang-test:///main.dart:4:11: Error: Final field 'kjsdf' is not initialized.
+// Try to initialize the field in the declaration or in every constructor.
+// final a kjsdf ksjdf ;
+// ^^^^^
+//
+// org-dartlang-test:///main.dart:4:17: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
+// Try adding the name of the type of the variable or the keyword 'var'.
+// final a kjsdf ksjdf ;
+// ^^^^^
+//
+// org-dartlang-test:///main.dart:4:9: Error: 'a' isn't a type.
+// final a kjsdf ksjdf ;
+// ^
+//
+// org-dartlang-test:///main.dart:4:9: Error: Type 'a' not found.
+// final a kjsdf ksjdf ;
+// ^
+//
+// org-dartlang-test:///main.dart:5:12: Error: 'a' isn't an instance field of this class.
+// Foo(this.a);
+// ^
+//
+
+ abstract class BIterator extends dart.core::Iterator<dynamic> {
+ synthetic constructor •() → main::BIterator*
+ : super dart.core::Iterator::•()
+ ;
+ abstract member-signature method moveNext() → dart.core::bool*; -> dart.core::Iterator::moveNext
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ class Foo extends dart.core::Object {
+ final field invalid-type kjsdf = null;
+ field dynamic ksjdf = null;
+ constructor •(dynamic a) → main::Foo*
+ : final dynamic #t1 = invalid-expression "org-dartlang-test:///main.dart:5:12: Error: 'a' isn't an instance field of this class.\n Foo(this.a);\n ^"
+ ;
+ abstract member-signature get _identityHashCode() → dart.core::int*; -> dart.core::Object::_identityHashCode
+ abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → dart.core::bool*; -> dart.core::Object::_instanceOf
+ abstract member-signature method _simpleInstanceOf(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOf
+ abstract member-signature method _simpleInstanceOfTrue(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfTrue
+ abstract member-signature method _simpleInstanceOfFalse(dynamic type) → dart.core::bool*; -> dart.core::Object::_simpleInstanceOfFalse
+ abstract member-signature operator ==(dynamic other) → dart.core::bool*; -> dart.core::Object::==
+ abstract member-signature get hashCode() → dart.core::int*; -> dart.core::Object::hashCode
+ abstract member-signature method toString() → dart.core::String*; -> dart.core::Object::toString
+ abstract member-signature method noSuchMethod(dart.core::Invocation* invocation) → dynamic; -> dart.core::Object::noSuchMethod
+ abstract member-signature get runtimeType() → dart.core::Type*; -> dart.core::Object::runtimeType
+ }
+ static method main() → dynamic {
+ new main::Foo::•(5);
+ return 2;
+ }
+}
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart b/pkg/front_end/testcases/nnbd/issue43256.dart
new file mode 100644
index 0000000..5c72c9e
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart
@@ -0,0 +1,59 @@
+// 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.
+
+var i = 1;
+
+Map<int, String>? nullableMap = {1: "Let", 2: "it", 3: "be"};
+
+List<int>? nullableList = [1, 2, 3];
+
+dynamic dynamicMap = {1: "Let", 2: "it", 3: "be"};
+
+dynamic dynamicList = [1, 2, 3];
+
+var map1 = {
+ if (i > 0) ...nullableMap, // error
+ if (i > 0) ...dynamicMap, // ok
+ if (i > 0) ...nullableMap!, // ok
+};
+
+var set1 = {
+ 0,
+ if (i > 0) ...nullableList, // error
+ if (i > 0) ...dynamicList, // ok
+ if (i > 0) ...nullableList! // ok
+};
+
+var list1 = [
+ if (i > 0) ...nullableList, // error
+ if (i > 0) ...dynamicList, // ok
+ if (i > 0) ...nullableList!, // ok
+];
+
+testMap<X extends dynamic, Y extends Map<int, String>?,
+ Z extends Map<int, String>>(X x, Y y, Z z) {
+ var map2 = {
+ if (i > 0) ...x, // error
+ if (i > 0) ...y, // error
+ if (i > 0) ...z, // ok
+ if (i > 0) ...y!, // ok
+ };
+}
+
+testIterables<X extends dynamic, Y extends List<int>?, Z extends List<int>>(
+ X x, Y y, Z z) {
+ var set2 = {
+ 0,
+ if (i > 0) ...x, // error
+ if (i > 0) ...y, // error
+ if (i > 0) ...z, // ok
+ };
+ var list2 = [
+ if (i > 0) ...x, // error
+ if (i > 0) ...y, // error
+ if (i > 0) ...z, // ok
+ ];
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.outline.expect
new file mode 100644
index 0000000..d008a19
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.outline.expect
@@ -0,0 +1,18 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+static field core::int i;
+static field core::Map<core::int, core::String>? nullableMap;
+static field core::List<core::int>? nullableList;
+static field dynamic dynamicMap;
+static field dynamic dynamicList;
+static field core::Map<dynamic, dynamic> map1;
+static field core::Set<dynamic> set1;
+static field core::List<dynamic> list1;
+static method testMap<X extends dynamic = dynamic, Y extends core::Map<core::int, core::String>? = core::Map<core::int, core::String>?, Z extends core::Map<core::int, core::String> = core::Map<core::int, core::String>>(self::testMap::X% x, self::testMap::Y% y, self::testMap::Z z) → dynamic
+ ;
+static method testIterables<X extends dynamic = dynamic, Y extends core::List<core::int>? = core::List<core::int>?, Z extends core::List<core::int> = core::List<core::int>>(self::testIterables::X% x, self::testIterables::Y% y, self::testIterables::Z z) → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.strong.expect
new file mode 100644
index 0000000..0d7d725
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.strong.expect
@@ -0,0 +1,140 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableMap, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:collection" as col;
+
+static field core::int i = 1;
+static field core::Map<core::int, core::String>? nullableMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field core::List<core::int>? nullableList = <core::int>[1, 2, 3];
+static field dynamic dynamicMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field dynamic dynamicList = <core::int>[1, 2, 3];
+static field core::Map<dynamic, dynamic> map1 = block {
+ final core::Map<dynamic, dynamic> #t1 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t1.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableMap, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t2 in (self::dynamicMap as{TypeError,ForDynamic,ForNonNullableByDefault} core::Map<dynamic, dynamic>).{core::Map::entries})
+ #t1.{core::Map::[]=}(#t2.{core::MapEntry::key}, #t2.{core::MapEntry::value});
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t3 in self::nullableMap!.{core::Map::entries})
+ #t1.{core::Map::[]=}(#t3.{core::MapEntry::key}, #t3.{core::MapEntry::value});
+} =>#t1;
+static field core::Set<dynamic> set1 = block {
+ final core::Set<dynamic> #t4 = col::LinkedHashSet::•<dynamic>();
+ #t4.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t4.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t5 in self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>)
+ #t4.{core::Set::add}(#t5);
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t6 in self::nullableList!)
+ #t4.{core::Set::add}(#t6);
+} =>#t4;
+static field core::List<dynamic> list1 = block {
+ final core::List<dynamic> #t7 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t7.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t8 in self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>)
+ #t7.{core::List::add}(#t8);
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t9 in self::nullableList!)
+ #t7.{core::List::add}(#t9);
+} =>#t7;
+static method testMap<X extends dynamic = dynamic, Y extends core::Map<core::int, core::String>? = core::Map<core::int, core::String>?, Z extends core::Map<core::int, core::String> = core::Map<core::int, core::String>>(self::testMap::X% x, self::testMap::Y% y, self::testMap::Z z) → dynamic {
+ core::Map<dynamic, dynamic> map2 = block {
+ final core::Map<dynamic, dynamic> #t10 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+ if (i > 0) ...x, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t11 in z.{core::Map::entries})
+ #t10.{core::Map::[]=}(#t11.{core::MapEntry::key}, #t11.{core::MapEntry::value});
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t12 in y!.{core::Map::entries})
+ #t10.{core::Map::[]=}(#t12.{core::MapEntry::key}, #t12.{core::MapEntry::value});
+ } =>#t10;
+}
+static method testIterables<X extends dynamic = dynamic, Y extends core::List<core::int>? = core::List<core::int>?, Z extends core::List<core::int> = core::List<core::int>>(self::testIterables::X% x, self::testIterables::Y% y, self::testIterables::Z z) → dynamic {
+ core::Set<dynamic> set2 = block {
+ final core::Set<dynamic> #t13 = col::LinkedHashSet::•<dynamic>();
+ #t13.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t14 in z)
+ #t13.{core::Set::add}(#t14);
+ } =>#t13;
+ core::List<dynamic> list2 = block {
+ final core::List<dynamic> #t15 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t16 in z)
+ #t15.{core::List::add}(#t16);
+ } =>#t15;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.strong.transformed.expect
new file mode 100644
index 0000000..ef9e80c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.strong.transformed.expect
@@ -0,0 +1,180 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableMap, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:collection" as col;
+
+static field core::int i = 1;
+static field core::Map<core::int, core::String>? nullableMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field core::List<core::int>? nullableList = <core::int>[1, 2, 3];
+static field dynamic dynamicMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field dynamic dynamicList = <core::int>[1, 2, 3];
+static field core::Map<dynamic, dynamic> map1 = block {
+ final core::Map<dynamic, dynamic> #t1 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t1.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableMap, // error
+ ^", null);
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<dynamic, dynamic>> :sync-for-iterator = (self::dynamicMap as{TypeError,ForDynamic,ForNonNullableByDefault} core::Map<dynamic, dynamic>).{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t2 = :sync-for-iterator.{core::Iterator::current};
+ #t1.{core::Map::[]=}(#t2.{core::MapEntry::key}, #t2.{core::MapEntry::value});
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<core::int, core::String>> :sync-for-iterator = self::nullableMap!.{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t3 = :sync-for-iterator.{core::Iterator::current};
+ #t1.{core::Map::[]=}(#t3.{core::MapEntry::key}, #t3.{core::MapEntry::value});
+ }
+ }
+} =>#t1;
+static field core::Set<dynamic> set1 = block {
+ final core::Set<dynamic> #t4 = new col::_CompactLinkedHashSet::•<dynamic>();
+ #t4.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t4.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<dynamic> :sync-for-iterator = (self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>).{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t5 = :sync-for-iterator.{core::Iterator::current};
+ #t4.{core::Set::add}(#t5);
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = self::nullableList!.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t6 = :sync-for-iterator.{core::Iterator::current};
+ #t4.{core::Set::add}(#t6);
+ }
+ }
+} =>#t4;
+static field core::List<dynamic> list1 = block {
+ final core::List<dynamic> #t7 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t7.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<dynamic> :sync-for-iterator = (self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>).{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t8 = :sync-for-iterator.{core::Iterator::current};
+ #t7.{core::List::add}(#t8);
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = self::nullableList!.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t9 = :sync-for-iterator.{core::Iterator::current};
+ #t7.{core::List::add}(#t9);
+ }
+ }
+} =>#t7;
+static method testMap<X extends dynamic = dynamic, Y extends core::Map<core::int, core::String>? = core::Map<core::int, core::String>?, Z extends core::Map<core::int, core::String> = core::Map<core::int, core::String>>(self::testMap::X% x, self::testMap::Y% y, self::testMap::Z z) → dynamic {
+ core::Map<dynamic, dynamic> map2 = block {
+ final core::Map<dynamic, dynamic> #t10 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+ if (i > 0) ...x, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^", null);
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<core::int, core::String>> :sync-for-iterator = z.{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t11 = :sync-for-iterator.{core::Iterator::current};
+ #t10.{core::Map::[]=}(#t11.{core::MapEntry::key}, #t11.{core::MapEntry::value});
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<core::int, core::String>> :sync-for-iterator = y!.{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t12 = :sync-for-iterator.{core::Iterator::current};
+ #t10.{core::Map::[]=}(#t12.{core::MapEntry::key}, #t12.{core::MapEntry::value});
+ }
+ }
+ } =>#t10;
+}
+static method testIterables<X extends dynamic = dynamic, Y extends core::List<core::int>? = core::List<core::int>?, Z extends core::List<core::int> = core::List<core::int>>(self::testIterables::X% x, self::testIterables::Y% y, self::testIterables::Z z) → dynamic {
+ core::Set<dynamic> set2 = block {
+ final core::Set<dynamic> #t13 = new col::_CompactLinkedHashSet::•<dynamic>();
+ #t13.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = z.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t14 = :sync-for-iterator.{core::Iterator::current};
+ #t13.{core::Set::add}(#t14);
+ }
+ }
+ } =>#t13;
+ core::List<dynamic> list2 = block {
+ final core::List<dynamic> #t15 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = z.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t16 = :sync-for-iterator.{core::Iterator::current};
+ #t15.{core::List::add}(#t16);
+ }
+ }
+ } =>#t15;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.textual_outline.expect
new file mode 100644
index 0000000..8fbb6e9
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.textual_outline.expect
@@ -0,0 +1,26 @@
+var i = 1;
+Map<int, String>? nullableMap = {1: "Let", 2: "it", 3: "be"};
+List<int>? nullableList = [1, 2, 3];
+dynamic dynamicMap = {1: "Let", 2: "it", 3: "be"};
+dynamic dynamicList = [1, 2, 3];
+var map1 = {
+ if (i > 0) ...nullableMap,
+ if (i > 0) ...dynamicMap,
+ if (i > 0) ...nullableMap!,
+};
+var set1 = {
+ 0,
+ if (i > 0) ...nullableList,
+ if (i > 0) ...dynamicList,
+ if (i > 0) ...nullableList!
+};
+var list1 = [
+ if (i > 0) ...nullableList,
+ if (i > 0) ...dynamicList,
+ if (i > 0) ...nullableList!,
+];
+testMap<X extends dynamic, Y extends Map<int, String>?,
+ Z extends Map<int, String>>(X x, Y y, Z z) {}
+testIterables<X extends dynamic, Y extends List<int>?, Z extends List<int>>(
+ X x, Y y, Z z) {}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..51913c7
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.textual_outline_modelled.expect
@@ -0,0 +1,26 @@
+List<int>? nullableList = [1, 2, 3];
+Map<int, String>? nullableMap = {1: "Let", 2: "it", 3: "be"};
+dynamic dynamicList = [1, 2, 3];
+dynamic dynamicMap = {1: "Let", 2: "it", 3: "be"};
+main() {}
+testIterables<X extends dynamic, Y extends List<int>?, Z extends List<int>>(
+ X x, Y y, Z z) {}
+testMap<X extends dynamic, Y extends Map<int, String>?,
+ Z extends Map<int, String>>(X x, Y y, Z z) {}
+var i = 1;
+var list1 = [
+ if (i > 0) ...nullableList,
+ if (i > 0) ...dynamicList,
+ if (i > 0) ...nullableList!,
+];
+var map1 = {
+ if (i > 0) ...nullableMap,
+ if (i > 0) ...dynamicMap,
+ if (i > 0) ...nullableMap!,
+};
+var set1 = {
+ 0,
+ if (i > 0) ...nullableList,
+ if (i > 0) ...dynamicList,
+ if (i > 0) ...nullableList!
+};
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.weak.expect
new file mode 100644
index 0000000..0d7d725
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.weak.expect
@@ -0,0 +1,140 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableMap, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:collection" as col;
+
+static field core::int i = 1;
+static field core::Map<core::int, core::String>? nullableMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field core::List<core::int>? nullableList = <core::int>[1, 2, 3];
+static field dynamic dynamicMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field dynamic dynamicList = <core::int>[1, 2, 3];
+static field core::Map<dynamic, dynamic> map1 = block {
+ final core::Map<dynamic, dynamic> #t1 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t1.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableMap, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t2 in (self::dynamicMap as{TypeError,ForDynamic,ForNonNullableByDefault} core::Map<dynamic, dynamic>).{core::Map::entries})
+ #t1.{core::Map::[]=}(#t2.{core::MapEntry::key}, #t2.{core::MapEntry::value});
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t3 in self::nullableMap!.{core::Map::entries})
+ #t1.{core::Map::[]=}(#t3.{core::MapEntry::key}, #t3.{core::MapEntry::value});
+} =>#t1;
+static field core::Set<dynamic> set1 = block {
+ final core::Set<dynamic> #t4 = col::LinkedHashSet::•<dynamic>();
+ #t4.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t4.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t5 in self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>)
+ #t4.{core::Set::add}(#t5);
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t6 in self::nullableList!)
+ #t4.{core::Set::add}(#t6);
+} =>#t4;
+static field core::List<dynamic> list1 = block {
+ final core::List<dynamic> #t7 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t7.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t8 in self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>)
+ #t7.{core::List::add}(#t8);
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t9 in self::nullableList!)
+ #t7.{core::List::add}(#t9);
+} =>#t7;
+static method testMap<X extends dynamic = dynamic, Y extends core::Map<core::int, core::String>? = core::Map<core::int, core::String>?, Z extends core::Map<core::int, core::String> = core::Map<core::int, core::String>>(self::testMap::X% x, self::testMap::Y% y, self::testMap::Z z) → dynamic {
+ core::Map<dynamic, dynamic> map2 = block {
+ final core::Map<dynamic, dynamic> #t10 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+ if (i > 0) ...x, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t11 in z.{core::Map::entries})
+ #t10.{core::Map::[]=}(#t11.{core::MapEntry::key}, #t11.{core::MapEntry::value});
+ if(self::i.{core::num::>}(0))
+ for (final core::MapEntry<dynamic, dynamic> #t12 in y!.{core::Map::entries})
+ #t10.{core::Map::[]=}(#t12.{core::MapEntry::key}, #t12.{core::MapEntry::value});
+ } =>#t10;
+}
+static method testIterables<X extends dynamic = dynamic, Y extends core::List<core::int>? = core::List<core::int>?, Z extends core::List<core::int> = core::List<core::int>>(self::testIterables::X% x, self::testIterables::Y% y, self::testIterables::Z z) → dynamic {
+ core::Set<dynamic> set2 = block {
+ final core::Set<dynamic> #t13 = col::LinkedHashSet::•<dynamic>();
+ #t13.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t14 in z)
+ #t13.{core::Set::add}(#t14);
+ } =>#t13;
+ core::List<dynamic> list2 = block {
+ final core::List<dynamic> #t15 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ for (final dynamic #t16 in z)
+ #t15.{core::List::add}(#t16);
+ } =>#t15;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/issue43256.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue43256.dart.weak.transformed.expect
new file mode 100644
index 0000000..ef9e80c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43256.dart.weak.transformed.expect
@@ -0,0 +1,180 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableMap, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...nullableList, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+// if (i > 0) ...x, // error
+// ^
+//
+// pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+// if (i > 0) ...y, // error
+// ^
+//
+import self as self;
+import "dart:core" as core;
+import "dart:collection" as col;
+
+static field core::int i = 1;
+static field core::Map<core::int, core::String>? nullableMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field core::List<core::int>? nullableList = <core::int>[1, 2, 3];
+static field dynamic dynamicMap = <core::int, core::String>{1: "Let", 2: "it", 3: "be"};
+static field dynamic dynamicList = <core::int>[1, 2, 3];
+static field core::Map<dynamic, dynamic> map1 = block {
+ final core::Map<dynamic, dynamic> #t1 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t1.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:16:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableMap, // error
+ ^", null);
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<dynamic, dynamic>> :sync-for-iterator = (self::dynamicMap as{TypeError,ForDynamic,ForNonNullableByDefault} core::Map<dynamic, dynamic>).{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t2 = :sync-for-iterator.{core::Iterator::current};
+ #t1.{core::Map::[]=}(#t2.{core::MapEntry::key}, #t2.{core::MapEntry::value});
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<core::int, core::String>> :sync-for-iterator = self::nullableMap!.{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t3 = :sync-for-iterator.{core::Iterator::current};
+ #t1.{core::Map::[]=}(#t3.{core::MapEntry::key}, #t3.{core::MapEntry::value});
+ }
+ }
+} =>#t1;
+static field core::Set<dynamic> set1 = block {
+ final core::Set<dynamic> #t4 = new col::_CompactLinkedHashSet::•<dynamic>();
+ #t4.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t4.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:23:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<dynamic> :sync-for-iterator = (self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>).{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t5 = :sync-for-iterator.{core::Iterator::current};
+ #t4.{core::Set::add}(#t5);
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = self::nullableList!.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t6 = :sync-for-iterator.{core::Iterator::current};
+ #t4.{core::Set::add}(#t6);
+ }
+ }
+} =>#t4;
+static field core::List<dynamic> list1 = block {
+ final core::List<dynamic> #t7 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t7.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:29:17: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...nullableList, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<dynamic> :sync-for-iterator = (self::dynamicList as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>).{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t8 = :sync-for-iterator.{core::Iterator::current};
+ #t7.{core::List::add}(#t8);
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = self::nullableList!.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t9 = :sync-for-iterator.{core::Iterator::current};
+ #t7.{core::List::add}(#t9);
+ }
+ }
+} =>#t7;
+static method testMap<X extends dynamic = dynamic, Y extends core::Map<core::int, core::String>? = core::Map<core::int, core::String>?, Z extends core::Map<core::int, core::String> = core::Map<core::int, core::String>>(self::testMap::X% x, self::testMap::Y% y, self::testMap::Z z) → dynamic {
+ core::Map<dynamic, dynamic> map2 = block {
+ final core::Map<dynamic, dynamic> #t10 = <dynamic, dynamic>{};
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:37:19: Error: Unexpected type 'X' of a map spread entry. Expected 'dynamic' or a Map.
+ if (i > 0) ...x, // error
+ ^", null);
+ if(self::i.{core::num::>}(0))
+ #t10.{core::Map::[]=}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:38:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^", null);
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<core::int, core::String>> :sync-for-iterator = z.{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t11 = :sync-for-iterator.{core::Iterator::current};
+ #t10.{core::Map::[]=}(#t11.{core::MapEntry::key}, #t11.{core::MapEntry::value});
+ }
+ }
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::MapEntry<core::int, core::String>> :sync-for-iterator = y!.{core::Map::entries}.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final core::MapEntry<dynamic, dynamic> #t12 = :sync-for-iterator.{core::Iterator::current};
+ #t10.{core::Map::[]=}(#t12.{core::MapEntry::key}, #t12.{core::MapEntry::value});
+ }
+ }
+ } =>#t10;
+}
+static method testIterables<X extends dynamic = dynamic, Y extends core::List<core::int>? = core::List<core::int>?, Z extends core::List<core::int> = core::List<core::int>>(self::testIterables::X% x, self::testIterables::Y% y, self::testIterables::Z z) → dynamic {
+ core::Set<dynamic> set2 = block {
+ final core::Set<dynamic> #t13 = new col::_CompactLinkedHashSet::•<dynamic>();
+ #t13.{core::Set::add}(0);
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:48:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t13.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:49:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = z.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t14 = :sync-for-iterator.{core::Iterator::current};
+ #t13.{core::Set::add}(#t14);
+ }
+ }
+ } =>#t13;
+ core::List<dynamic> list2 = block {
+ final core::List<dynamic> #t15 = <dynamic>[];
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:53:19: Error: Unexpected type 'X' of a spread. Expected 'dynamic' or an Iterable.
+ if (i > 0) ...x, // error
+ ^");
+ if(self::i.{core::num::>}(0))
+ #t15.{core::List::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue43256.dart:54:19: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
+ if (i > 0) ...y, // error
+ ^");
+ if(self::i.{core::num::>}(0)) {
+ core::Iterator<core::int> :sync-for-iterator = z.{core::Iterable::iterator};
+ for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
+ final dynamic #t16 = :sync-for-iterator.{core::Iterator::current};
+ #t15.{core::List::add}(#t16);
+ }
+ }
+ } =>#t15;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/rasta/super_initializer.dart.strong.expect b/pkg/front_end/testcases/rasta/super_initializer.dart.strong.expect
index 4ccdd4a..03f043f 100644
--- a/pkg/front_end/testcases/rasta/super_initializer.dart.strong.expect
+++ b/pkg/front_end/testcases/rasta/super_initializer.dart.strong.expect
@@ -2,16 +2,16 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/rasta/super_initializer.dart:14:15: Error: Can't have initializers after 'super'.
-// : super.arg0(),
+// pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
+// field = 42;
// ^
//
-// pkg/front_end/testcases/rasta/super_initializer.dart:17:15: Error: Can't have initializers after 'super'.
-// : super.arg1(a),
+// pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
+// field = 42;
// ^
//
-// pkg/front_end/testcases/rasta/super_initializer.dart:20:15: Error: Can't have initializers after 'super'.
-// : super.arg2(a, b),
+// pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
+// field = 42;
// ^
//
import self as self;
@@ -41,18 +41,18 @@
class Sub extends self::Super {
field dynamic field;
constructor arg0() → self::Sub*
- : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:14:15: Error: Can't have initializers after 'super'.
- : super.arg0(),
+ : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
+ field = 42;
^", super self::Super::arg0()
;
constructor arg1(dynamic a) → self::Sub*
- : final dynamic #t2 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:17:15: Error: Can't have initializers after 'super'.
- : super.arg1(a),
+ : final dynamic #t2 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
+ field = 42;
^", super self::Super::arg1(a)
;
constructor arg2(dynamic a, dynamic b) → self::Sub*
- : final dynamic #t3 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:20:15: Error: Can't have initializers after 'super'.
- : super.arg2(a, b),
+ : final dynamic #t3 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
+ field = 42;
^", super self::Super::arg2(a, b)
;
}
diff --git a/pkg/front_end/testcases/rasta/super_initializer.dart.strong.transformed.expect b/pkg/front_end/testcases/rasta/super_initializer.dart.strong.transformed.expect
index 4ccdd4a..03f043f 100644
--- a/pkg/front_end/testcases/rasta/super_initializer.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/rasta/super_initializer.dart.strong.transformed.expect
@@ -2,16 +2,16 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/rasta/super_initializer.dart:14:15: Error: Can't have initializers after 'super'.
-// : super.arg0(),
+// pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
+// field = 42;
// ^
//
-// pkg/front_end/testcases/rasta/super_initializer.dart:17:15: Error: Can't have initializers after 'super'.
-// : super.arg1(a),
+// pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
+// field = 42;
// ^
//
-// pkg/front_end/testcases/rasta/super_initializer.dart:20:15: Error: Can't have initializers after 'super'.
-// : super.arg2(a, b),
+// pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
+// field = 42;
// ^
//
import self as self;
@@ -41,18 +41,18 @@
class Sub extends self::Super {
field dynamic field;
constructor arg0() → self::Sub*
- : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:14:15: Error: Can't have initializers after 'super'.
- : super.arg0(),
+ : final dynamic #t1 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:15:15: Error: Can't have initializers after 'super'.
+ field = 42;
^", super self::Super::arg0()
;
constructor arg1(dynamic a) → self::Sub*
- : final dynamic #t2 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:17:15: Error: Can't have initializers after 'super'.
- : super.arg1(a),
+ : final dynamic #t2 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:18:15: Error: Can't have initializers after 'super'.
+ field = 42;
^", super self::Super::arg1(a)
;
constructor arg2(dynamic a, dynamic b) → self::Sub*
- : final dynamic #t3 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:20:15: Error: Can't have initializers after 'super'.
- : super.arg2(a, b),
+ : final dynamic #t3 = invalid-expression "pkg/front_end/testcases/rasta/super_initializer.dart:21:15: Error: Can't have initializers after 'super'.
+ field = 42;
^", super self::Super::arg2(a, b)
;
}
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index e461ce3..446a07f 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -635,8 +635,14 @@
}
++i2;
++i1;
+ if (next.classNode.isAnonymousMixin) {
+ // Never find unnamed mixin application in least upper bound.
+ continue;
+ }
if (next.depth != currentDepth) {
- if (numCandidatesAtThisDepth == 1) return candidate;
+ if (numCandidatesAtThisDepth == 1) {
+ return candidate;
+ }
currentDepth = next.depth;
numCandidatesAtThisDepth = 0;
candidate = null;
diff --git a/pkg/kernel/lib/transformations/scanner.dart b/pkg/kernel/lib/transformations/scanner.dart
new file mode 100644
index 0000000..5083fa6
--- /dev/null
+++ b/pkg/kernel/lib/transformations/scanner.dart
@@ -0,0 +1,51 @@
+library kernel.transformations.scanner;
+
+import '../ast.dart';
+import '../kernel.dart';
+
+abstract class Scanner<X extends TreeNode, Y extends TreeNode> {
+ final Scanner<Y, TreeNode> next;
+ Scanner(this.next);
+ bool predicate(X x);
+ ScanResult<X, Y> scan(TreeNode node);
+}
+
+class ScanResult<X extends TreeNode, Y extends TreeNode> {
+ Map<X, ScanResult<Y, TreeNode>> targets;
+ Map<X, ScanError> errors;
+}
+
+class ScanError {}
+
+abstract class ClassScanner<Y extends TreeNode> implements Scanner<Class, Y> {
+ final Scanner<Y, TreeNode> next;
+
+ ClassScanner(this.next);
+
+ bool predicate(Class node);
+
+ ScanResult<Class, Y> scan(TreeNode node) {
+ ScanResult<Class, Y> result = new ScanResult();
+ result.targets = new Map();
+ if (node is Class) {
+ if (predicate(node)) {
+ result.targets[node] = next?.scan(node);
+ }
+ } else if (node is Library) {
+ for (Class cls in node.classes) {
+ if (predicate(cls)) {
+ result.targets[cls] = next?.scan(cls);
+ }
+ }
+ } else if (node is Component) {
+ for (Library library in node.libraries) {
+ for (Class cls in library.classes) {
+ if (predicate(cls)) {
+ result.targets[cls] = next?.scan(cls);
+ }
+ }
+ }
+ }
+ return result;
+ }
+}
diff --git a/pkg/kernel/lib/transformations/value_class.dart b/pkg/kernel/lib/transformations/value_class.dart
index afda4be..9e38786 100644
--- a/pkg/kernel/lib/transformations/value_class.dart
+++ b/pkg/kernel/lib/transformations/value_class.dart
@@ -8,15 +8,31 @@
import '../kernel.dart';
import '../core_types.dart' show CoreTypes;
import '../class_hierarchy.dart' show ClassHierarchy;
+import './scanner.dart';
+
+class ValueClassScanner extends ClassScanner<Null> {
+ ValueClassScanner() : super(null);
+
+ bool predicate(Class node) {
+ for (Expression annotation in node.annotations) {
+ if (annotation is ConstantExpression &&
+ annotation.constant is StringConstant) {
+ StringConstant constant = annotation.constant;
+ if (constant.value == 'valueClass') {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
void transformComponent(
Component node, CoreTypes coreTypes, ClassHierarchy hierarchy) {
- for (Library library in node.libraries) {
- for (Class cls in library.classes) {
- if (isValueClass(cls)) {
- transformValueClass(cls, coreTypes, hierarchy);
- }
- }
+ ValueClassScanner scanner = new ValueClassScanner();
+ ScanResult<Class, Null> valueClasses = scanner.scan(node);
+ for (Class valueClass in valueClasses.targets.keys) {
+ transformValueClass(valueClass, coreTypes, hierarchy);
}
}
diff --git a/pkg/kernel/lib/verifier.dart b/pkg/kernel/lib/verifier.dart
index a826d66..5ad6c85 100644
--- a/pkg/kernel/lib/verifier.dart
+++ b/pkg/kernel/lib/verifier.dart
@@ -796,6 +796,21 @@
" type arguments, but the class declares"
" ${node.classNode.typeParameters.length} parameters.");
}
+ if (node.classNode.isAnonymousMixin) {
+ if (currentParent is FunctionNode) {
+ TreeNode functionNodeParent = currentParent.parent;
+ if (functionNodeParent is Constructor ||
+ functionNodeParent is Procedure &&
+ functionNodeParent.kind == ProcedureKind.Factory) {
+ if (functionNodeParent.parent == node.classNode) {
+ // We only allow references to anonymous mixins in types as the
+ // return type of its own constructor.
+ return;
+ }
+ }
+ }
+ problem(currentParent, "Type $node references an anonymous mixin class.");
+ }
}
@override
diff --git a/tests/language/compile_time_constant/p_test.dart b/tests/language/compile_time_constant/p_test.dart
index 031e929..133519f 100644
--- a/tests/language/compile_time_constant/p_test.dart
+++ b/tests/language/compile_time_constant/p_test.dart
@@ -9,7 +9,7 @@
this.x
// ^
// [analyzer] COMPILE_TIME_ERROR.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
- // [cfe] 'x' is a final instance variable that has already been initialized.
+ // [cfe] 'x' is a final instance variable that was initialized at the declaration.
// ^
// [cfe] Cannot invoke a non-'const' constructor where a const expression is expected.
);
diff --git a/tests/language/const/constructor_syntax_test.dart b/tests/language/const/constructor_syntax_test.dart
index d214271..ea34671 100644
--- a/tests/language/const/constructor_syntax_test.dart
+++ b/tests/language/const/constructor_syntax_test.dart
@@ -36,7 +36,6 @@
const C1();
// ^^
// [analyzer] COMPILE_TIME_ERROR.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
-// ^
// [cfe] Constructor is marked 'const' so all fields must be final.
var modifiable;
}
@@ -51,7 +50,7 @@
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
// ^
- // [cfe] 'field' is a final instance variable that has already been initialized.
+ // [cfe] 'field' is a final instance variable that was initialized at the declaration.
// ^
// [cfe] Cannot invoke a non-'const' constructor where a const expression is expected.
// ^^^^^^^^
diff --git a/tests/language/const/syntax_test.dart b/tests/language/const/syntax_test.dart
index d9eb889..138d30c 100644
--- a/tests/language/const/syntax_test.dart
+++ b/tests/language/const/syntax_test.dart
@@ -9,14 +9,12 @@
const f1;
// ^^
// [analyzer] COMPILE_TIME_ERROR.CONST_NOT_INITIALIZED
- // ^
- // [cfe] The const variable ';' must be initialized.
+ // [cfe] The const variable 'f1' must be initialized.
const int f2 = 87;
const int f3;
// ^^
// [analyzer] COMPILE_TIME_ERROR.CONST_NOT_INITIALIZED
- // ^
- // [cfe] The const variable ';' must be initialized.
+ // [cfe] The const variable 'f3' must be initialized.
Expect.equals(42, f0);
Expect.equals(87, f2);
@@ -59,10 +57,9 @@
// [cfe] The const variable 'F1' must be initialized.
const int F2 = 87;
const int F3;
-// ^
-// [cfe] The const variable 'F3' must be initialized.
// ^^
// [analyzer] COMPILE_TIME_ERROR.CONST_NOT_INITIALIZED
+// [cfe] The const variable 'F3' must be initialized.
class Point {
final x, y;
@@ -113,7 +110,7 @@
//^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
// ^
- // [cfe] 'x' is a final instance variable that has already been initialized.
+ // [cfe] 'x' is a final instance variable that was initialized at the declaration.
// ^
// [cfe] Cannot invoke a non-'const' constructor where a const expression is expected.
;
diff --git a/tests/language/constructor/duplicate_initializers_test.dart b/tests/language/constructor/duplicate_initializers_test.dart
index 1b4125a..4f6699e 100644
--- a/tests/language/constructor/duplicate_initializers_test.dart
+++ b/tests/language/constructor/duplicate_initializers_test.dart
@@ -10,7 +10,7 @@
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
// ^
- // [cfe] 'field_' is a final instance variable that has already been initialized.
+ // [cfe] 'field_' was already initialized by this constructor.
;
Class.field(this.field_)
// Test against duplicate final field initialization between initializing
@@ -19,15 +19,15 @@
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER
// ^
- // [cfe] 'field_' is a final instance variable that has already been initialized.
+ // [cfe] 'field_' was already initialized by this constructor.
;
// Test against duplicate final field initialization in initializing formals.
Class.two_fields(this.field_
, this.field_
// ^^^^^^
- // [cfe] 'field_' is a final instance variable that has already been initialized.
- // ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FINAL_INITIALIZED_MULTIPLE_TIMES
+ // [cfe] 'field_' was already initialized by this constructor.
+ // ^
// [cfe] Duplicated parameter name 'field_'.
);
final field_;
diff --git a/tests/language/constructor/redirect2_test.dart b/tests/language/constructor/redirect2_test.dart
index 0999747..30d7ab6 100644
--- a/tests/language/constructor/redirect2_test.dart
+++ b/tests/language/constructor/redirect2_test.dart
@@ -18,20 +18,20 @@
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
// ^
- // [cfe] Can't have other initializers together with 'this'.
+ // [cfe] A redirecting constructor can't have other initializers.
// Redirecting constructor must not have initializing formal parameters.
A.illegalFormal(this.x) : this(3);
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
// ^
- // [cfe] Can't have other initializers together with 'this'.
+ // [cfe] A redirecting constructor can't have other initializers.
// Redirection constructors must not call super constructor.
A.illegalSuper() : this(3), super(3);
// ^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_IN_REDIRECTING_CONSTRUCTOR
- // [cfe] Can't have other initializers together with 'this'.
+ // [cfe] A redirecting constructor can't have other initializers.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS
// [cfe] Too many positional arguments: 0 allowed, but 1 found.
diff --git a/tests/language/final/attempt_reinitialization_test.dart b/tests/language/final/attempt_reinitialization_test.dart
index 2db5efe..67c2de9 100644
--- a/tests/language/final/attempt_reinitialization_test.dart
+++ b/tests/language/final/attempt_reinitialization_test.dart
@@ -6,7 +6,7 @@
Foo(this.x);
// ^
// [analyzer] COMPILE_TIME_ERROR.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
- // [cfe] 'x' is a final instance variable that has already been initialized.
+ // [cfe] 'x' is a final instance variable that was initialized at the declaration.
final int x = 42;
}
@@ -17,7 +17,7 @@
// ^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
// ^
- // [cfe] 'shopName' is a final instance variable that has already been initialized.
+ // [cfe] 'shopName' is a final instance variable that was initialized at the declaration.
}
void main() {
diff --git a/tests/language/variable/initializer_super_last_test.dart b/tests/language/variable/initializer_super_last_test.dart
index 8a4ab9d..5a96d03 100644
--- a/tests/language/variable/initializer_super_last_test.dart
+++ b/tests/language/variable/initializer_super_last_test.dart
@@ -41,63 +41,71 @@
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
C.cc10(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
C.cc11(this.x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc12(this.x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc13(int x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc14(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc15(int x)
: x = x,
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc16(int x)
: x = x,
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc17(int x)
: x = x,
@@ -126,63 +134,71 @@
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
const C.cc26(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
const C.cc27(this.x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc28(this.x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc29(int x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc30(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc31(int x)
: x = x,
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc32(int x)
: x = x,
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
}
main() {
diff --git a/tests/language_2/compile_time_constant/p_test.dart b/tests/language_2/compile_time_constant/p_test.dart
index 031e929..133519f 100644
--- a/tests/language_2/compile_time_constant/p_test.dart
+++ b/tests/language_2/compile_time_constant/p_test.dart
@@ -9,7 +9,7 @@
this.x
// ^
// [analyzer] COMPILE_TIME_ERROR.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
- // [cfe] 'x' is a final instance variable that has already been initialized.
+ // [cfe] 'x' is a final instance variable that was initialized at the declaration.
// ^
// [cfe] Cannot invoke a non-'const' constructor where a const expression is expected.
);
diff --git a/tests/language_2/const/constructor_syntax_test.dart b/tests/language_2/const/constructor_syntax_test.dart
index d214271..ea34671 100644
--- a/tests/language_2/const/constructor_syntax_test.dart
+++ b/tests/language_2/const/constructor_syntax_test.dart
@@ -36,7 +36,6 @@
const C1();
// ^^
// [analyzer] COMPILE_TIME_ERROR.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
-// ^
// [cfe] Constructor is marked 'const' so all fields must be final.
var modifiable;
}
@@ -51,7 +50,7 @@
//^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
// ^
- // [cfe] 'field' is a final instance variable that has already been initialized.
+ // [cfe] 'field' is a final instance variable that was initialized at the declaration.
// ^
// [cfe] Cannot invoke a non-'const' constructor where a const expression is expected.
// ^^^^^^^^
diff --git a/tests/language_2/const/syntax_test.dart b/tests/language_2/const/syntax_test.dart
index 375fb6a..138d30c 100644
--- a/tests/language_2/const/syntax_test.dart
+++ b/tests/language_2/const/syntax_test.dart
@@ -110,7 +110,7 @@
//^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
// ^
- // [cfe] 'x' is a final instance variable that has already been initialized.
+ // [cfe] 'x' is a final instance variable that was initialized at the declaration.
// ^
// [cfe] Cannot invoke a non-'const' constructor where a const expression is expected.
;
diff --git a/tests/language_2/constructor/duplicate_initializers_test.dart b/tests/language_2/constructor/duplicate_initializers_test.dart
index 1b4125a..4f6699e 100644
--- a/tests/language_2/constructor/duplicate_initializers_test.dart
+++ b/tests/language_2/constructor/duplicate_initializers_test.dart
@@ -10,7 +10,7 @@
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS
// ^
- // [cfe] 'field_' is a final instance variable that has already been initialized.
+ // [cfe] 'field_' was already initialized by this constructor.
;
Class.field(this.field_)
// Test against duplicate final field initialization between initializing
@@ -19,15 +19,15 @@
//^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER
// ^
- // [cfe] 'field_' is a final instance variable that has already been initialized.
+ // [cfe] 'field_' was already initialized by this constructor.
;
// Test against duplicate final field initialization in initializing formals.
Class.two_fields(this.field_
, this.field_
// ^^^^^^
- // [cfe] 'field_' is a final instance variable that has already been initialized.
- // ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FINAL_INITIALIZED_MULTIPLE_TIMES
+ // [cfe] 'field_' was already initialized by this constructor.
+ // ^
// [cfe] Duplicated parameter name 'field_'.
);
final field_;
diff --git a/tests/language_2/constructor/redirect2_test.dart b/tests/language_2/constructor/redirect2_test.dart
index 0999747..30d7ab6 100644
--- a/tests/language_2/constructor/redirect2_test.dart
+++ b/tests/language_2/constructor/redirect2_test.dart
@@ -18,20 +18,20 @@
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
// ^
- // [cfe] Can't have other initializers together with 'this'.
+ // [cfe] A redirecting constructor can't have other initializers.
// Redirecting constructor must not have initializing formal parameters.
A.illegalFormal(this.x) : this(3);
// ^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
// ^
- // [cfe] Can't have other initializers together with 'this'.
+ // [cfe] A redirecting constructor can't have other initializers.
// Redirection constructors must not call super constructor.
A.illegalSuper() : this(3), super(3);
// ^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.SUPER_IN_REDIRECTING_CONSTRUCTOR
- // [cfe] Can't have other initializers together with 'this'.
+ // [cfe] A redirecting constructor can't have other initializers.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.EXTRA_POSITIONAL_ARGUMENTS
// [cfe] Too many positional arguments: 0 allowed, but 1 found.
diff --git a/tests/language_2/final/attempt_reinitialization_test.dart b/tests/language_2/final/attempt_reinitialization_test.dart
index 2db5efe..67c2de9 100644
--- a/tests/language_2/final/attempt_reinitialization_test.dart
+++ b/tests/language_2/final/attempt_reinitialization_test.dart
@@ -6,7 +6,7 @@
Foo(this.x);
// ^
// [analyzer] COMPILE_TIME_ERROR.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
- // [cfe] 'x' is a final instance variable that has already been initialized.
+ // [cfe] 'x' is a final instance variable that was initialized at the declaration.
final int x = 42;
}
@@ -17,7 +17,7 @@
// ^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
// ^
- // [cfe] 'shopName' is a final instance variable that has already been initialized.
+ // [cfe] 'shopName' is a final instance variable that was initialized at the declaration.
}
void main() {
diff --git a/tests/language_2/variable/initializer_super_last_test.dart b/tests/language_2/variable/initializer_super_last_test.dart
index 8a4ab9d..5a96d03 100644
--- a/tests/language_2/variable/initializer_super_last_test.dart
+++ b/tests/language_2/variable/initializer_super_last_test.dart
@@ -41,63 +41,71 @@
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
C.cc10(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
C.cc11(this.x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc12(this.x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc13(int x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc14(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc15(int x)
: x = x,
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
C.cc16(int x)
: x = x,
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc17(int x)
: x = x,
@@ -126,63 +134,71 @@
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
const C.cc26(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x;
+ //^
+ // [cfe] Can't have initializers after 'super'.
const C.cc27(this.x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc28(this.x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc29(int x)
: //
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc30(int x)
: //
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
x = x,
+ //^
+ // [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc31(int x)
: x = x,
super(),
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
const C.cc32(int x)
: x = x,
super.named(),
// ^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_SUPER_INVOCATION
-// ^
-// [cfe] Can't have initializers after 'super'.
assert(x == x);
+// ^
+// [cfe] Can't have initializers after 'super'.
}
main() {
diff --git a/tools/VERSION b/tools/VERSION
index 7ec9e7a..54f30f2 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 107
+PRERELEASE 108
PRERELEASE_PATCH 0
\ No newline at end of file