Version 2.17.0-252.0.dev
Merge commit '0797fe6dbccced8fd1c1f1904576c9f9a3466846' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c521f6..35ae0e5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -222,7 +222,16 @@
tracker.
`dart --verbose pub [command]` will also cause the log file to be written.
+- `dart pub global activate --source=git` now takes arguments `--git-path` to
+ specify the path of the activated package in the pubspec and `--git-ref` to
+ specify the branch or revision to check out.
- `dart pub add` can now add multiple packages in one command.
+- `dart pub token add` can now add a token for [pub.dev](https://pub.dev).
+- `dart pub uploader` has been removed. To manage uploaders for a package use
+ the `https://pub.dev/<packagename>/admin` web-interface.
+- Pub now supports a separate `pubspec_overrides.yaml` file that can contain
+ `dependency_overrides`. This makes it easier to avoid checking the local
+ overrides into version control.
#### Linter
diff --git a/DEPS b/DEPS
index 7447d02..b0759a3 100644
--- a/DEPS
+++ b/DEPS
@@ -141,7 +141,7 @@
"pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
"process_rev": "56ece43b53b64c63ae51ec184b76bd5360c28d0b",
"protobuf_rev": "c1eb6cb51af39ccbaa1a8e19349546586a5c8e31",
- "pub_rev": "8f5ab7b1aba3b9f66b56246d77e167990339d317",
+ "pub_rev": "94ae66a660cc187cc46ceaf1ab96bdcf8d48a313",
"pub_semver_rev": "ea6c54019948dc03042c595ce9413e17aaf7aa38",
"root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50",
"rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244",
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index db72005..1ce1f0a 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -85,7 +85,7 @@
var error = errors[0];
expect(error.severity, AnalysisErrorSeverity.ERROR);
expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR);
- expect(error.location.file, testFilePathPlatform);
+ expect(error.location.file, testFile.path);
expect(error.location.startLine, 2);
}
}
diff --git a/pkg/analysis_server/test/analysis_server_base.dart b/pkg/analysis_server/test/analysis_server_base.dart
index 6d6a1bf..8dbec0e 100644
--- a/pkg/analysis_server/test/analysis_server_base.dart
+++ b/pkg/analysis_server/test/analysis_server_base.dart
@@ -92,8 +92,6 @@
String get testFilePath => '$testPackageLibPath/test.dart';
- String get testFilePathPlatform => convertPath(testFilePath);
-
String get testPackageLibPath => '$testPackageRootPath/lib';
Folder get testPackageRoot => getFolder(testPackageRootPath);
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 8fce9e5..1ad43e5 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -563,7 +563,7 @@
// Add an overlay without errors.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay(''),
+ testFile.path: AddContentOverlay(''),
}).toRequest('0'),
);
@@ -573,7 +573,7 @@
await _waitAnalysisComplete();
_assertAnalyzedFiles(
hasErrors: [],
- noErrors: [testFilePathPlatform],
+ noErrors: [testFile.path],
notAnalyzed: [],
);
@@ -584,13 +584,13 @@
await _waitAnalysisComplete();
_assertAnalyzedFiles(
hasErrors: [],
- notAnalyzed: [testFilePathPlatform],
+ notAnalyzed: [testFile.path],
);
// Ask to remove the overlay, still active, start a timer.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: RemoveContentOverlay(),
+ testFile.path: RemoveContentOverlay(),
}).toRequest('0'),
);
@@ -600,7 +600,7 @@
// The file has errors.
await _waitAnalysisComplete();
_assertAnalyzedFiles(
- hasErrors: [testFilePathPlatform],
+ hasErrors: [testFile.path],
noErrors: [],
notAnalyzed: [],
);
@@ -616,7 +616,7 @@
// Add an overlay without errors.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay(''),
+ testFile.path: AddContentOverlay(''),
}).toRequest('0'),
);
@@ -626,7 +626,7 @@
await _waitAnalysisComplete();
_assertAnalyzedFiles(
hasErrors: [],
- noErrors: [testFilePathPlatform],
+ noErrors: [testFile.path],
notAnalyzed: [],
);
@@ -637,13 +637,13 @@
await _waitAnalysisComplete();
_assertAnalyzedFiles(
hasErrors: [],
- notAnalyzed: [testFilePathPlatform],
+ notAnalyzed: [testFile.path],
);
// Ask to remove the overlay, still active, start a timer.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: RemoveContentOverlay(),
+ testFile.path: RemoveContentOverlay(),
}).toRequest('0'),
);
@@ -651,7 +651,7 @@
await _waitAnalysisComplete();
_assertAnalyzedFiles(
hasErrors: [],
- notAnalyzed: [testFilePathPlatform],
+ notAnalyzed: [testFile.path],
);
// Change the file again, has errors.
@@ -660,7 +660,7 @@
// The timer cancelled on the watch event, and the file analyzed.
await _waitAnalysisComplete();
_assertAnalyzedFiles(
- hasErrors: [testFilePathPlatform],
+ hasErrors: [testFile.path],
noErrors: [],
notAnalyzed: [],
);
@@ -897,7 +897,7 @@
// Add an overlay without errors.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay(''),
+ testFile.path: AddContentOverlay(''),
}).toRequest('0'),
);
@@ -907,21 +907,21 @@
await _waitAnalysisComplete();
_assertAnalyzedFiles(
hasErrors: [],
- noErrors: [testFilePathPlatform],
+ noErrors: [testFile.path],
notAnalyzed: [],
);
// Ask to remove the overlay, still active, start a timer.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: RemoveContentOverlay(),
+ testFile.path: RemoveContentOverlay(),
}).toRequest('0'),
);
// Re-add an overlay. Should cancel the timer and replace the overlay.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay(''),
+ testFile.path: AddContentOverlay(''),
}).toRequest('0'),
);
@@ -933,7 +933,7 @@
// The overlay should still be present, so we should be able to change it.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: ChangeContentOverlay(
+ testFile.path: ChangeContentOverlay(
[SourceEdit(0, 0, '//')],
),
}).toRequest('0'),
@@ -1283,14 +1283,14 @@
}
Future<void> test_updateContent_addOverlay() async {
- newFile2('$testFilePath', 'error');
+ newFile2(testFilePath, 'error');
await setRoots(included: [workspaceRootPath], excluded: []);
// The file in the file system has errors.
await server.onAnalysisComplete;
_assertAnalyzedFiles(
- hasErrors: [testFilePathPlatform],
+ hasErrors: [testFile.path],
noErrors: [],
notAnalyzed: [],
);
@@ -1298,7 +1298,7 @@
// Add an overlay without errors.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay(''),
+ testFile.path: AddContentOverlay(''),
}).toRequest('0'),
);
@@ -1306,18 +1306,18 @@
await server.onAnalysisComplete;
_assertAnalyzedFiles(
hasErrors: [],
- noErrors: [testFilePathPlatform],
+ noErrors: [testFile.path],
notAnalyzed: [],
);
}
Future<void> test_updateContent_changeOverlay() async {
- newFile2('$testFilePath', '');
+ newFile2(testFilePath, '');
// Add the content with an error.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay('var v = 0'),
+ testFile.path: AddContentOverlay('var v = 0'),
}).toRequest('0'),
);
@@ -1326,7 +1326,7 @@
// The overlay has an error.
await server.onAnalysisComplete;
_assertAnalyzedFiles(
- hasErrors: [testFilePathPlatform],
+ hasErrors: [testFile.path],
noErrors: [],
notAnalyzed: [],
);
@@ -1334,7 +1334,7 @@
// Add the missing `;`.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: ChangeContentOverlay([
+ testFile.path: ChangeContentOverlay([
SourceEdit(9, 0, ';'),
]),
}).toRequest('0'),
@@ -1344,7 +1344,7 @@
await server.onAnalysisComplete;
_assertAnalyzedFiles(
hasErrors: [],
- noErrors: [testFilePathPlatform],
+ noErrors: [testFile.path],
notAnalyzed: [],
);
}
@@ -1374,20 +1374,20 @@
String initialContent,
SourceEdit edit,
) async {
- newFile2('$testFilePath', initialContent);
+ newFile2(testFilePath, initialContent);
await setRoots(included: [workspaceRootPath], excluded: []);
await server.onAnalysisComplete;
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay(initialContent),
+ testFile.path: AddContentOverlay(initialContent),
}).toRequest('0'),
);
var response = await handleRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: ChangeContentOverlay([edit]),
+ testFile.path: ChangeContentOverlay([edit]),
}).toRequest('0'),
);
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index ab580d0..03ec19a 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -59,7 +59,7 @@
check(details)
..completion.isEqualTo('Random')
..change
- .hasFileEdit(testFilePathPlatform)
+ .hasFileEdit(testFile.path)
.appliedTo(testFileContent)
.isEqualTo(r'''
import 'dart:math';
@@ -97,7 +97,7 @@
check(details)
..completion.isEqualTo('Test')
..change
- .hasFileEdit(testFilePathPlatform)
+ .hasFileEdit(testFile.path)
.appliedTo(testFileContent)
.isEqualTo(r'''
import 'package:aaa/a.dart';
@@ -123,7 +123,7 @@
check(details)
..completion.isEqualTo('Test')
..change
- .hasFileEdit(testFilePathPlatform)
+ .hasFileEdit(testFile.path)
.appliedTo(testFileContent)
.isEqualTo(r'''
import 'package:test/a.dart';
@@ -138,7 +138,7 @@
await _configureWithWorkspaceRoot();
var request = CompletionGetSuggestionDetails2Params(
- testFilePathPlatform, 0, 'Random', '[foo]:bar')
+ testFile.path, 0, 'Random', '[foo]:bar')
.toRequest('0');
var response = await handleRequest(request);
@@ -281,7 +281,7 @@
// Simulate typing in the IDE.
await handleSuccessfulRequest(
AnalysisUpdateContentParams({
- testFilePathPlatform: AddContentOverlay('void f() {}'),
+ testFile.path: AddContentOverlay('void f() {}'),
}).toRequest('1'),
);
@@ -1975,7 +1975,7 @@
RequestWithFutureResponse _sendTestCompletionRequest(String id, int offset) {
var request = CompletionGetSuggestions2Params(
- testFilePathPlatform,
+ testFile.path,
0,
1 << 10,
).toRequest(id);
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 6a43b83..c80a680 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -534,7 +534,7 @@
// The `package:test` uses the class `A` from the `package:aaa`.
// So it sees the declaration the element `A`.
- newFile2('$testFilePath', '''
+ newFile2(testFilePath, '''
import 'package:aaa/a.dart';
class B extends A {}
''');
diff --git a/pkg/dart2wasm/lib/intrinsics.dart b/pkg/dart2wasm/lib/intrinsics.dart
index 498580c..0fa9329 100644
--- a/pkg/dart2wasm/lib/intrinsics.dart
+++ b/pkg/dart2wasm/lib/intrinsics.dart
@@ -619,6 +619,7 @@
if (node.target.enclosingLibrary.name == "dart._internal") {
switch (name) {
case "unsafeCast":
+ case "unsafeCastOpaque":
w.ValueType targetType =
translator.translateType(node.arguments.types.single);
Expression operand = node.arguments.positional.single;
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 80ca725..07a3764 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1854,6 +1854,7 @@
List<Expression>? positionalSuperParametersAsArguments;
List<NamedExpression>? namedSuperParametersAsArguments;
+ Set<String>? namedSuperParameterNames;
if (formals != null) {
for (FormalParameterBuilder formal in formals) {
if (formal.isSuperInitializingFormal) {
@@ -1865,6 +1866,7 @@
forNullGuardedAccess: false)
..fileOffset = formal.charOffset)
..fileOffset = formal.charOffset);
+ (namedSuperParameterNames ??= <String>{}).add(formal.name);
} else {
(positionalSuperParametersAsArguments ??= <Expression>[]).add(
new VariableGetImpl(formal.variable!,
@@ -1886,7 +1888,7 @@
superInitializer.fileOffset, noLength))
..parent = constructor;
} else if (libraryBuilder.enableSuperParametersInLibrary) {
- Arguments arguments = superInitializer.arguments;
+ ArgumentsImpl arguments = superInitializer.arguments as ArgumentsImpl;
if (positionalSuperParametersAsArguments != null) {
if (arguments.positional.isNotEmpty) {
@@ -1904,12 +1906,14 @@
} else {
arguments.positional.addAll(positionalSuperParametersAsArguments);
setParents(positionalSuperParametersAsArguments, arguments);
+ arguments.positionalAreSuperParameters = true;
}
}
if (namedSuperParametersAsArguments != null) {
// TODO(cstefantsova): Report name conflicts.
arguments.named.addAll(namedSuperParametersAsArguments);
setParents(namedSuperParametersAsArguments, arguments);
+ arguments.namedSuperParameterNames = namedSuperParameterNames;
}
}
} else if (initializers.last is RedirectingInitializer) {
@@ -1958,7 +1962,7 @@
/// >unless the enclosing class is class Object.
Constructor? superTarget = lookupConstructor(emptyName, isSuper: true);
Initializer initializer;
- Arguments arguments;
+ ArgumentsImpl arguments;
List<Expression>? positionalArguments;
List<NamedExpression>? namedArguments;
if (libraryBuilder.enableSuperParametersInLibrary) {
@@ -1976,6 +1980,7 @@
forNullGuardedAccess: false)
]);
}
+
if (positionalArguments != null || namedArguments != null) {
arguments = forest.createArguments(
noLocation, positionalArguments ?? <Expression>[],
@@ -1983,6 +1988,11 @@
} else {
arguments = forest.createArgumentsEmpty(noLocation);
}
+
+ arguments.positionalAreSuperParameters =
+ positionalSuperParametersAsArguments != null;
+ arguments.namedSuperParameterNames = namedSuperParameterNames;
+
if (superTarget == null ||
checkArgumentsForFunction(superTarget.function, arguments,
builder.charOffset, const <TypeParameter>[]) !=
diff --git a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
index 354dddc..3009ba1 100644
--- a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
@@ -493,6 +493,17 @@
List<Object?>? argumentsOriginalOrder;
+ /// True if the arguments are passed to the super-constructor in a
+ /// super-initializer, and the positional parameters are super-initializer
+ /// parameters. It is true that either all of the positional parameters are
+ /// super-initializer parameters or none of them, so a simple boolean
+ /// accurately reflects the state.
+ bool positionalAreSuperParameters = false;
+
+ /// Names of the named positional parameters. If none of the parameters are
+ /// super-positional, the field is null.
+ Set<String>? namedSuperParameterNames;
+
ArgumentsImpl.internal(
{required List<Expression> positional,
required List<DartType>? types,
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 1f1f6b2..8dbfdac 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -494,6 +494,7 @@
DartType? declaredContextType,
DartType? runtimeCheckedType,
bool isVoidAllowed: false,
+ bool coerceExpression: true,
Template<Message Function(DartType, DartType, bool)>? errorTemplate,
Template<Message Function(DartType, DartType, bool)>?
nullabilityErrorTemplate,
@@ -509,6 +510,7 @@
declaredContextType: declaredContextType,
runtimeCheckedType: runtimeCheckedType,
isVoidAllowed: isVoidAllowed,
+ coerceExpression: coerceExpression,
errorTemplate: errorTemplate,
nullabilityErrorTemplate: nullabilityErrorTemplate,
nullabilityNullErrorTemplate: nullabilityNullErrorTemplate,
@@ -527,6 +529,7 @@
DartType? declaredContextType,
DartType? runtimeCheckedType,
bool isVoidAllowed: false,
+ bool coerceExpression: true,
Template<Message Function(DartType, DartType, bool)>? errorTemplate,
Template<Message Function(DartType, DartType, bool)>?
nullabilityErrorTemplate,
@@ -578,7 +581,8 @@
contextType, inferenceResult.inferredType,
isNonNullableByDefault: isNonNullableByDefault,
isVoidAllowed: isVoidAllowed,
- isExpressionTypePrecise: preciseTypeErrorTemplate != null);
+ isExpressionTypePrecise: preciseTypeErrorTemplate != null,
+ coerceExpression: coerceExpression);
if (assignabilityResult.needsTearOff) {
TypedTearoff typedTearoff = _tearOffCall(inferenceResult.expression,
@@ -782,7 +786,8 @@
DartType contextType, DartType expressionType,
{required bool isNonNullableByDefault,
required bool isVoidAllowed,
- required bool isExpressionTypePrecise}) {
+ required bool isExpressionTypePrecise,
+ required bool coerceExpression}) {
// ignore: unnecessary_null_comparison
assert(isNonNullableByDefault != null);
// ignore: unnecessary_null_comparison
@@ -794,7 +799,7 @@
// should tear off `.call`.
// TODO(paulberry): use resolveTypeParameter. See findInterfaceMember.
bool needsTearoff = false;
- if (expressionType is InterfaceType) {
+ if (coerceExpression && expressionType is InterfaceType) {
Class classNode = expressionType.classNode;
Member? callMember =
classHierarchy.getInterfaceMember(classNode, callName);
@@ -813,7 +818,7 @@
}
}
ImplicitInstantiation? implicitInstantiation;
- if (libraryBuilder.enableConstructorTearOffsInLibrary) {
+ if (coerceExpression && libraryBuilder.enableConstructorTearOffsInLibrary) {
implicitInstantiation =
computeImplicitInstantiation(expressionType, contextType);
if (implicitInstantiation != null) {
@@ -867,8 +872,15 @@
return const AssignabilityResult(AssignabilityKind.unassignablePrecise,
needsTearOff: false);
}
- // Insert an implicit downcast.
- return new AssignabilityResult(AssignabilityKind.assignableCast,
+
+ if (coerceExpression) {
+ // Insert an implicit downcast.
+ return new AssignabilityResult(AssignabilityKind.assignableCast,
+ needsTearOff: needsTearoff,
+ implicitInstantiation: implicitInstantiation);
+ }
+
+ return new AssignabilityResult(AssignabilityKind.unassignable,
needsTearOff: needsTearoff,
implicitInstantiation: implicitInstantiation);
}
@@ -2618,17 +2630,23 @@
DartType actualType = actualTypes![i];
Expression expression;
NamedExpression? namedExpression;
+ bool coerceExpression;
if (i < numPositionalArgs) {
expression = arguments.positional[positionalShift + i];
positionalArgumentTypes.add(actualType);
+ coerceExpression = !arguments.positionalAreSuperParameters;
} else {
namedExpression = arguments.named[i - numPositionalArgs];
expression = namedExpression.value;
namedArgumentTypes
.add(new NamedType(namedExpression.name, actualType));
+ coerceExpression = !(arguments.namedSuperParameterNames
+ ?.contains(namedExpression.name) ??
+ false);
}
expression = ensureAssignable(expectedType, actualType, expression,
isVoidAllowed: expectedType is VoidType,
+ coerceExpression: coerceExpression,
// TODO(johnniwinther): Specialize message for operator
// invocations.
errorTemplate: templateArgumentTypeNotAssignable,
diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt
index 1d062f6..c09bea1 100644
--- a/pkg/front_end/test/spell_checking_list_common.txt
+++ b/pkg/front_end/test/spell_checking_list_common.txt
@@ -47,6 +47,7 @@
accounted
accumulate
accurate
+accurately
achieve
act
acting
@@ -489,6 +490,7 @@
closures
clue
code
+coerce
coincides
coinductively
collapses
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart b/pkg/front_end/testcases/super_parameters/no_coercions.dart
new file mode 100644
index 0000000..942256b
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart
@@ -0,0 +1,82 @@
+// Copyright (c) 2022, 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 A1 {
+ A1(int x);
+}
+
+class B1 extends A1 {
+ B1.one(dynamic super.x); // Error.
+ B1.two(dynamic super.x) : super(); // Error.
+}
+
+class A2 {
+ A2({required String x});
+}
+
+class B2 extends A2 {
+ B2.one({required dynamic super.x}); // Error.
+ B2.two({required dynamic super.x}) : super(); // Error.
+}
+
+class A3 {
+ A3(num Function(double) f);
+}
+
+class B3 extends A3 {
+ B3.one(X Function<X>(double) super.f); // Error.
+ B3.two(X Function<X>(double) super.f) : super(); // Error.
+}
+
+class A4 {
+ A4({required num Function(double) f});
+}
+
+class B4 extends A4 {
+ B4.one({required X Function<X>(double) super.f}); // Error.
+ B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+}
+
+abstract class C5 {
+ String call(int x, num y);
+}
+
+class A5 {
+ A5(String Function(int, num) f);
+}
+
+class B5 extends A5 {
+ B5.one(C5 super.f); // Error.
+ B5.two(C5 super.f) : super(); // Error.
+}
+
+class A6 {
+ A6({required String Function(int, num) f});
+}
+
+class B6 extends A6 {
+ B6.one({required C5 super.f}); // Error.
+ B6.two({required C5 super.f}) : super(); // Error.
+}
+
+class A7 {
+ A7({required int x1,
+ required int x2,
+ required bool Function(Object) f1,
+ required bool Function(Object) f2,
+ required void Function(dynamic) g1,
+ required void Function(dynamic) g2});
+}
+
+class B7 extends A7 {
+ B7({required dynamic super.x1, // Error.
+ required dynamic x2,
+ required X Function<X>(Object) super.f1, // Error.
+ required X Function<X>(Object) f2,
+ required void Function<X>(X) super.g1, // Error.
+ required void Function<X>(X) g2}) :
+ super(x2: x2, f2: f2, g2: g2); // Ok.
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.expect
new file mode 100644
index 0000000..1d154d8
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.expect
@@ -0,0 +1,206 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.one(dynamic super.x); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.two(dynamic super.x) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.one({required dynamic super.x}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.two({required dynamic super.x}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.one(X Function<X>(double) super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.two(X Function<X>(double) super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.one({required X Function<X>(double) super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.one(C5 super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.two(C5 super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.one({required C5 super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.two({required C5 super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B7({required dynamic super.x1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+// - 'Object' is from 'dart:core'.
+// required X Function<X>(Object) super.f1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+// required void Function<X>(X) super.g1, // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A1 extends core::Object {
+ constructor •(core::int x) → self::A1
+ : super core::Object::•()
+ ;
+}
+class B1 extends self::A1 {
+ constructor one(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.one(dynamic super.x); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+ constructor two(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.two(dynamic super.x) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+}
+class A2 extends core::Object {
+ constructor •({required core::String x = #C1}) → self::A2
+ : super core::Object::•()
+ ;
+}
+class B2 extends self::A2 {
+ constructor one({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.one({required dynamic super.x}); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+ constructor two({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.two({required dynamic super.x}) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+}
+class A3 extends core::Object {
+ constructor •((core::double) → core::num f) → self::A3
+ : super core::Object::•()
+ ;
+}
+class B3 extends self::A3 {
+ constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.one(X Function<X>(double) super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.two(X Function<X>(double) super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+class A4 extends core::Object {
+ constructor •({required (core::double) → core::num f = #C1}) → self::A4
+ : super core::Object::•()
+ ;
+}
+class B4 extends self::A4 {
+ constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.one({required X Function<X>(double) super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+abstract class C5 extends core::Object {
+ synthetic constructor •() → self::C5
+ : super core::Object::•()
+ ;
+ abstract method call(core::int x, core::num y) → core::String;
+}
+class A5 extends core::Object {
+ constructor •((core::int, core::num) → core::String f) → self::A5
+ : super core::Object::•()
+ ;
+}
+class B5 extends self::A5 {
+ constructor one(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.one(C5 super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.two(C5 super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A6 extends core::Object {
+ constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
+ : super core::Object::•()
+ ;
+}
+class B6 extends self::A6 {
+ constructor one({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.one({required C5 super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.two({required C5 super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A7 extends core::Object {
+ constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
+ : super core::Object::•()
+ ;
+}
+class B7 extends self::A7 {
+ constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
+ : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B7({required dynamic super.x1, // Error.
+ ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+ - 'Object' is from 'dart:core'.
+ required X Function<X>(Object) super.f1, // Error.
+ ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+ required void Function<X>(X) super.g1, // Error.
+ ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.transformed.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.transformed.expect
new file mode 100644
index 0000000..1d154d8
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.strong.transformed.expect
@@ -0,0 +1,206 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.one(dynamic super.x); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.two(dynamic super.x) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.one({required dynamic super.x}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.two({required dynamic super.x}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.one(X Function<X>(double) super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.two(X Function<X>(double) super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.one({required X Function<X>(double) super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.one(C5 super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.two(C5 super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.one({required C5 super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.two({required C5 super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B7({required dynamic super.x1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+// - 'Object' is from 'dart:core'.
+// required X Function<X>(Object) super.f1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+// required void Function<X>(X) super.g1, // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A1 extends core::Object {
+ constructor •(core::int x) → self::A1
+ : super core::Object::•()
+ ;
+}
+class B1 extends self::A1 {
+ constructor one(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.one(dynamic super.x); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+ constructor two(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.two(dynamic super.x) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+}
+class A2 extends core::Object {
+ constructor •({required core::String x = #C1}) → self::A2
+ : super core::Object::•()
+ ;
+}
+class B2 extends self::A2 {
+ constructor one({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.one({required dynamic super.x}); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+ constructor two({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.two({required dynamic super.x}) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+}
+class A3 extends core::Object {
+ constructor •((core::double) → core::num f) → self::A3
+ : super core::Object::•()
+ ;
+}
+class B3 extends self::A3 {
+ constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.one(X Function<X>(double) super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.two(X Function<X>(double) super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+class A4 extends core::Object {
+ constructor •({required (core::double) → core::num f = #C1}) → self::A4
+ : super core::Object::•()
+ ;
+}
+class B4 extends self::A4 {
+ constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.one({required X Function<X>(double) super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+abstract class C5 extends core::Object {
+ synthetic constructor •() → self::C5
+ : super core::Object::•()
+ ;
+ abstract method call(core::int x, core::num y) → core::String;
+}
+class A5 extends core::Object {
+ constructor •((core::int, core::num) → core::String f) → self::A5
+ : super core::Object::•()
+ ;
+}
+class B5 extends self::A5 {
+ constructor one(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.one(C5 super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.two(C5 super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A6 extends core::Object {
+ constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
+ : super core::Object::•()
+ ;
+}
+class B6 extends self::A6 {
+ constructor one({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.one({required C5 super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.two({required C5 super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A7 extends core::Object {
+ constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
+ : super core::Object::•()
+ ;
+}
+class B7 extends self::A7 {
+ constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
+ : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B7({required dynamic super.x1, // Error.
+ ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+ - 'Object' is from 'dart:core'.
+ required X Function<X>(Object) super.f1, // Error.
+ ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+ required void Function<X>(X) super.g1, // Error.
+ ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline.expect
new file mode 100644
index 0000000..80093ec
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline.expect
@@ -0,0 +1,80 @@
+class A1 {
+ A1(int x);
+}
+
+class B1 extends A1 {
+ B1.one(dynamic super.x);
+ B1.two(dynamic super.x) : super();
+}
+
+class A2 {
+ A2({required String x});
+}
+
+class B2 extends A2 {
+ B2.one({required dynamic super.x});
+ B2.two({required dynamic super.x}) : super();
+}
+
+class A3 {
+ A3(num Function(double) f);
+}
+
+class B3 extends A3 {
+ B3.one(X Function<X>(double) super.f);
+ B3.two(X Function<X>(double) super.f) : super();
+}
+
+class A4 {
+ A4({required num Function(double) f});
+}
+
+class B4 extends A4 {
+ B4.one({required X Function<X>(double) super.f});
+ B4.two({required X Function<X>(double) super.f}) : super();
+}
+
+abstract class C5 {
+ String call(int x, num y);
+}
+
+class A5 {
+ A5(String Function(int, num) f);
+}
+
+class B5 extends A5 {
+ B5.one(C5 super.f);
+ B5.two(C5 super.f) : super();
+}
+
+class A6 {
+ A6({required String Function(int, num) f});
+}
+
+class B6 extends A6 {
+ B6.one({required C5 super.f});
+ B6.two({required C5 super.f}) : super();
+}
+
+class A7 {
+ A7(
+ {required int x1,
+ required int x2,
+ required bool Function(Object) f1,
+ required bool Function(Object) f2,
+ required void Function(dynamic) g1,
+ required void Function(dynamic) g2});
+}
+
+class B7 extends A7 {
+ B7(
+ {required dynamic super.x1,
+ required dynamic x2,
+ required X Function<X>(Object) super.f1,
+ required X Function<X>(Object) f2,
+ required void Function<X>(X) super.g1,
+ required void Function<X>(X) g2})
+ : super(x2: x2, f2: f2, g2: g2);
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..d6b43c6
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.textual_outline_modelled.expect
@@ -0,0 +1,80 @@
+abstract class C5 {
+ String call(int x, num y);
+}
+
+class A1 {
+ A1(int x);
+}
+
+class A2 {
+ A2({required String x});
+}
+
+class A3 {
+ A3(num Function(double) f);
+}
+
+class A4 {
+ A4({required num Function(double) f});
+}
+
+class A5 {
+ A5(String Function(int, num) f);
+}
+
+class A6 {
+ A6({required String Function(int, num) f});
+}
+
+class A7 {
+ A7(
+ {required int x1,
+ required int x2,
+ required bool Function(Object) f1,
+ required bool Function(Object) f2,
+ required void Function(dynamic) g1,
+ required void Function(dynamic) g2});
+}
+
+class B1 extends A1 {
+ B1.one(dynamic super.x);
+ B1.two(dynamic super.x) : super();
+}
+
+class B2 extends A2 {
+ B2.one({required dynamic super.x});
+ B2.two({required dynamic super.x}) : super();
+}
+
+class B3 extends A3 {
+ B3.one(X Function<X>(double) super.f);
+ B3.two(X Function<X>(double) super.f) : super();
+}
+
+class B4 extends A4 {
+ B4.one({required X Function<X>(double) super.f});
+ B4.two({required X Function<X>(double) super.f}) : super();
+}
+
+class B5 extends A5 {
+ B5.one(C5 super.f);
+ B5.two(C5 super.f) : super();
+}
+
+class B6 extends A6 {
+ B6.one({required C5 super.f});
+ B6.two({required C5 super.f}) : super();
+}
+
+class B7 extends A7 {
+ B7(
+ {required dynamic super.x1,
+ required dynamic x2,
+ required X Function<X>(Object) super.f1,
+ required X Function<X>(Object) f2,
+ required void Function<X>(X) super.g1,
+ required void Function<X>(X) g2})
+ : super(x2: x2, f2: f2, g2: g2);
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.expect
new file mode 100644
index 0000000..1d154d8
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.expect
@@ -0,0 +1,206 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.one(dynamic super.x); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.two(dynamic super.x) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.one({required dynamic super.x}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.two({required dynamic super.x}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.one(X Function<X>(double) super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.two(X Function<X>(double) super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.one({required X Function<X>(double) super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.one(C5 super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.two(C5 super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.one({required C5 super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.two({required C5 super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B7({required dynamic super.x1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+// - 'Object' is from 'dart:core'.
+// required X Function<X>(Object) super.f1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+// required void Function<X>(X) super.g1, // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A1 extends core::Object {
+ constructor •(core::int x) → self::A1
+ : super core::Object::•()
+ ;
+}
+class B1 extends self::A1 {
+ constructor one(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.one(dynamic super.x); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+ constructor two(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.two(dynamic super.x) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+}
+class A2 extends core::Object {
+ constructor •({required core::String x = #C1}) → self::A2
+ : super core::Object::•()
+ ;
+}
+class B2 extends self::A2 {
+ constructor one({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.one({required dynamic super.x}); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+ constructor two({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.two({required dynamic super.x}) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+}
+class A3 extends core::Object {
+ constructor •((core::double) → core::num f) → self::A3
+ : super core::Object::•()
+ ;
+}
+class B3 extends self::A3 {
+ constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.one(X Function<X>(double) super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.two(X Function<X>(double) super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+class A4 extends core::Object {
+ constructor •({required (core::double) → core::num f = #C1}) → self::A4
+ : super core::Object::•()
+ ;
+}
+class B4 extends self::A4 {
+ constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.one({required X Function<X>(double) super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+abstract class C5 extends core::Object {
+ synthetic constructor •() → self::C5
+ : super core::Object::•()
+ ;
+ abstract method call(core::int x, core::num y) → core::String;
+}
+class A5 extends core::Object {
+ constructor •((core::int, core::num) → core::String f) → self::A5
+ : super core::Object::•()
+ ;
+}
+class B5 extends self::A5 {
+ constructor one(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.one(C5 super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.two(C5 super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A6 extends core::Object {
+ constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
+ : super core::Object::•()
+ ;
+}
+class B6 extends self::A6 {
+ constructor one({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.one({required C5 super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.two({required C5 super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A7 extends core::Object {
+ constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
+ : super core::Object::•()
+ ;
+}
+class B7 extends self::A7 {
+ constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
+ : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B7({required dynamic super.x1, // Error.
+ ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+ - 'Object' is from 'dart:core'.
+ required X Function<X>(Object) super.f1, // Error.
+ ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+ required void Function<X>(X) super.g1, // Error.
+ ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.modular.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.modular.expect
new file mode 100644
index 0000000..1d154d8
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.modular.expect
@@ -0,0 +1,206 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.one(dynamic super.x); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.two(dynamic super.x) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.one({required dynamic super.x}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.two({required dynamic super.x}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.one(X Function<X>(double) super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.two(X Function<X>(double) super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.one({required X Function<X>(double) super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.one(C5 super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.two(C5 super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.one({required C5 super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.two({required C5 super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B7({required dynamic super.x1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+// - 'Object' is from 'dart:core'.
+// required X Function<X>(Object) super.f1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+// required void Function<X>(X) super.g1, // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A1 extends core::Object {
+ constructor •(core::int x) → self::A1
+ : super core::Object::•()
+ ;
+}
+class B1 extends self::A1 {
+ constructor one(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.one(dynamic super.x); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+ constructor two(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.two(dynamic super.x) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+}
+class A2 extends core::Object {
+ constructor •({required core::String x = #C1}) → self::A2
+ : super core::Object::•()
+ ;
+}
+class B2 extends self::A2 {
+ constructor one({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.one({required dynamic super.x}); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+ constructor two({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.two({required dynamic super.x}) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+}
+class A3 extends core::Object {
+ constructor •((core::double) → core::num f) → self::A3
+ : super core::Object::•()
+ ;
+}
+class B3 extends self::A3 {
+ constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.one(X Function<X>(double) super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.two(X Function<X>(double) super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+class A4 extends core::Object {
+ constructor •({required (core::double) → core::num f = #C1}) → self::A4
+ : super core::Object::•()
+ ;
+}
+class B4 extends self::A4 {
+ constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.one({required X Function<X>(double) super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+abstract class C5 extends core::Object {
+ synthetic constructor •() → self::C5
+ : super core::Object::•()
+ ;
+ abstract method call(core::int x, core::num y) → core::String;
+}
+class A5 extends core::Object {
+ constructor •((core::int, core::num) → core::String f) → self::A5
+ : super core::Object::•()
+ ;
+}
+class B5 extends self::A5 {
+ constructor one(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.one(C5 super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.two(C5 super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A6 extends core::Object {
+ constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
+ : super core::Object::•()
+ ;
+}
+class B6 extends self::A6 {
+ constructor one({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.one({required C5 super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.two({required C5 super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A7 extends core::Object {
+ constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
+ : super core::Object::•()
+ ;
+}
+class B7 extends self::A7 {
+ constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
+ : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B7({required dynamic super.x1, // Error.
+ ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+ - 'Object' is from 'dart:core'.
+ required X Function<X>(Object) super.f1, // Error.
+ ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+ required void Function<X>(X) super.g1, // Error.
+ ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.outline.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.outline.expect
new file mode 100644
index 0000000..7a8c89a
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.outline.expect
@@ -0,0 +1,79 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A1 extends core::Object {
+ constructor •(core::int x) → self::A1
+ ;
+}
+class B1 extends self::A1 {
+ constructor one(dynamic x) → self::B1
+ ;
+ constructor two(dynamic x) → self::B1
+ ;
+}
+class A2 extends core::Object {
+ constructor •({required core::String x}) → self::A2
+ ;
+}
+class B2 extends self::A2 {
+ constructor one({required dynamic x}) → self::B2
+ ;
+ constructor two({required dynamic x}) → self::B2
+ ;
+}
+class A3 extends core::Object {
+ constructor •((core::double) → core::num f) → self::A3
+ ;
+}
+class B3 extends self::A3 {
+ constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ ;
+ constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ ;
+}
+class A4 extends core::Object {
+ constructor •({required (core::double) → core::num f}) → self::A4
+ ;
+}
+class B4 extends self::A4 {
+ constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f}) → self::B4
+ ;
+ constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f}) → self::B4
+ ;
+}
+abstract class C5 extends core::Object {
+ synthetic constructor •() → self::C5
+ ;
+ abstract method call(core::int x, core::num y) → core::String;
+}
+class A5 extends core::Object {
+ constructor •((core::int, core::num) → core::String f) → self::A5
+ ;
+}
+class B5 extends self::A5 {
+ constructor one(self::C5 f) → self::B5
+ ;
+ constructor two(self::C5 f) → self::B5
+ ;
+}
+class A6 extends core::Object {
+ constructor •({required (core::int, core::num) → core::String f}) → self::A6
+ ;
+}
+class B6 extends self::A6 {
+ constructor one({required self::C5 f}) → self::B6
+ ;
+ constructor two({required self::C5 f}) → self::B6
+ ;
+}
+class A7 extends core::Object {
+ constructor •({required core::int x1, required core::int x2, required (core::Object) → core::bool f1, required (core::Object) → core::bool f2, required (dynamic) → void g1, required (dynamic) → void g2}) → self::A7
+ ;
+}
+class B7 extends self::A7 {
+ constructor •({required dynamic x1, required dynamic x2, required <X extends core::Object? = dynamic>(core::Object) → X% f1, required <X extends core::Object? = dynamic>(core::Object) → X% f2, required <X extends core::Object? = dynamic>(X%) → void g1, required <X extends core::Object? = dynamic>(X%) → void g2}) → self::B7
+ ;
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.transformed.expect b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.transformed.expect
new file mode 100644
index 0000000..1d154d8
--- /dev/null
+++ b/pkg/front_end/testcases/super_parameters/no_coercions.dart.weak.transformed.expect
@@ -0,0 +1,206 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.one(dynamic super.x); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B1.two(dynamic super.x) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.one({required dynamic super.x}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+// B2.two({required dynamic super.x}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.one(X Function<X>(double) super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B3.two(X Function<X>(double) super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.one({required X Function<X>(double) super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+// B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.one(C5 super.f); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B5.two(C5 super.f) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.one({required C5 super.f}); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+// - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+// B6.two({required C5 super.f}) : super(); // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+// B7({required dynamic super.x1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+// - 'Object' is from 'dart:core'.
+// required X Function<X>(Object) super.f1, // Error.
+// ^
+//
+// pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+// required void Function<X>(X) super.g1, // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+class A1 extends core::Object {
+ constructor •(core::int x) → self::A1
+ : super core::Object::•()
+ ;
+}
+class B1 extends self::A1 {
+ constructor one(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:10:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.one(dynamic super.x); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+ constructor two(dynamic x) → self::B1
+ : super self::A1::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:11:24: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B1.two(dynamic super.x) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::int)
+ ;
+}
+class A2 extends core::Object {
+ constructor •({required core::String x = #C1}) → self::A2
+ : super core::Object::•()
+ ;
+}
+class B2 extends self::A2 {
+ constructor one({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:19:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.one({required dynamic super.x}); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+ constructor two({required dynamic x = #C1}) → self::B2
+ : super self::A2::•(x: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:20:34: Error: The argument type 'dynamic' can't be assigned to the parameter type 'String'.
+ B2.two({required dynamic super.x}) : super(); // Error.
+ ^" in x as{TypeError,ForNonNullableByDefault} core::String)
+ ;
+}
+class A3 extends core::Object {
+ constructor •((core::double) → core::num f) → self::A3
+ : super core::Object::•()
+ ;
+}
+class B3 extends self::A3 {
+ constructor one(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:28:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.one(X Function<X>(double) super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two(<X extends core::Object? = dynamic>(core::double) → X% f) → self::B3
+ : super self::A3::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:29:38: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B3.two(X Function<X>(double) super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+class A4 extends core::Object {
+ constructor •({required (core::double) → core::num f = #C1}) → self::A4
+ : super core::Object::•()
+ ;
+}
+class B4 extends self::A4 {
+ constructor one({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:37:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.one({required X Function<X>(double) super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+ constructor two({required <X extends core::Object? = dynamic>(core::double) → X% f = #C1}) → self::B4
+ : super self::A4::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:38:48: Error: The argument type 'X Function<X>(double)' can't be assigned to the parameter type 'num Function(double)'.
+ B4.two({required X Function<X>(double) super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::double) → core::num)
+ ;
+}
+abstract class C5 extends core::Object {
+ synthetic constructor •() → self::C5
+ : super core::Object::•()
+ ;
+ abstract method call(core::int x, core::num y) → core::String;
+}
+class A5 extends core::Object {
+ constructor •((core::int, core::num) → core::String f) → self::A5
+ : super core::Object::•()
+ ;
+}
+class B5 extends self::A5 {
+ constructor one(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:50:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.one(C5 super.f); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two(self::C5 f) → self::B5
+ : super self::A5::•(invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:51:19: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B5.two(C5 super.f) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A6 extends core::Object {
+ constructor •({required (core::int, core::num) → core::String f = #C1}) → self::A6
+ : super core::Object::•()
+ ;
+}
+class B6 extends self::A6 {
+ constructor one({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:59:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.one({required C5 super.f}); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+ constructor two({required self::C5 f = #C1}) → self::B6
+ : super self::A6::•(f: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:60:29: Error: The argument type 'C5' can't be assigned to the parameter type 'String Function(int, num)'.
+ - 'C5' is from 'pkg/front_end/testcases/super_parameters/no_coercions.dart'.
+ B6.two({required C5 super.f}) : super(); // Error.
+ ^" in f as{TypeError,ForNonNullableByDefault} (core::int, core::num) → core::String)
+ ;
+}
+class A7 extends core::Object {
+ constructor •({required core::int x1 = #C1, required core::int x2 = #C1, required (core::Object) → core::bool f1 = #C1, required (core::Object) → core::bool f2 = #C1, required (dynamic) → void g1 = #C1, required (dynamic) → void g2 = #C1}) → self::A7
+ : super core::Object::•()
+ ;
+}
+class B7 extends self::A7 {
+ constructor •({required dynamic x1 = #C1, required dynamic x2 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f1 = #C1, required <X extends core::Object? = dynamic>(core::Object) → X% f2 = #C1, required <X extends core::Object? = dynamic>(X%) → void g1 = #C1, required <X extends core::Object? = dynamic>(X%) → void g2 = #C1}) → self::B7
+ : super self::A7::•(x2: x2 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int, f2: f2<core::bool>, g2: g2<dynamic>, x1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:73:30: Error: The argument type 'dynamic' can't be assigned to the parameter type 'int'.
+ B7({required dynamic super.x1, // Error.
+ ^" in x1 as{TypeError,ForNonNullableByDefault} core::int, f1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:75:44: Error: The argument type 'X Function<X>(Object)' can't be assigned to the parameter type 'bool Function(Object)'.
+ - 'Object' is from 'dart:core'.
+ required X Function<X>(Object) super.f1, // Error.
+ ^" in f1 as{TypeError,ForNonNullableByDefault} (core::Object) → core::bool, g1: invalid-expression "pkg/front_end/testcases/super_parameters/no_coercions.dart:77:42: Error: The argument type 'void Function<X>(X)' can't be assigned to the parameter type 'void Function(dynamic)'.
+ required void Function<X>(X) super.g1, // Error.
+ ^" in g1 as{TypeError,ForNonNullableByDefault} (dynamic) → void)
+ ;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = null
+}
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc
index 967b525..08da16e 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc
@@ -2453,7 +2453,7 @@
return false;
}
-void FlowGraphCompiler::GenerateCidRangesCheck(
+bool FlowGraphCompiler::GenerateCidRangesCheck(
compiler::Assembler* assembler,
Register class_id_reg,
const CidRangeVector& cid_ranges,
@@ -2467,7 +2467,7 @@
if (fall_through_if_inside) {
assembler->Jump(outside_range_lbl);
}
- return;
+ return false;
}
int bias = 0;
@@ -2484,6 +2484,27 @@
bias = EmitTestAndCallCheckCid(assembler, jump_label, class_id_reg, range,
bias, jump_on_miss);
}
+ return bias != 0;
+}
+
+int FlowGraphCompiler::EmitTestAndCallCheckCid(compiler::Assembler* assembler,
+ compiler::Label* label,
+ Register class_id_reg,
+ const CidRangeValue& range,
+ int bias,
+ bool jump_on_miss) {
+ const intptr_t cid_start = range.cid_start;
+ if (range.IsSingleCid()) {
+ assembler->CompareImmediate(class_id_reg, cid_start - bias);
+ assembler->BranchIf(jump_on_miss ? NOT_EQUAL : EQUAL, label);
+ } else {
+ assembler->AddImmediate(class_id_reg, bias - cid_start);
+ bias = cid_start;
+ assembler->CompareImmediate(class_id_reg, range.Extent());
+ assembler->BranchIf(jump_on_miss ? UNSIGNED_GREATER : UNSIGNED_LESS_EQUAL,
+ label);
+ }
+ return bias;
}
bool FlowGraphCompiler::CheckAssertAssignableTypeTestingABILocations(
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.h b/runtime/vm/compiler/backend/flow_graph_compiler.h
index f53e11f..f533e32 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.h
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.h
@@ -721,7 +721,9 @@
// If [fall_through_if_inside] is `true`, then [outside_range_lbl] must be
// supplied, since it will be jumped to in the last case if the cid is outside
// the range.
- static void GenerateCidRangesCheck(compiler::Assembler* assembler,
+ //
+ // Returns whether [class_id_reg] is clobbered by the check.
+ static bool GenerateCidRangesCheck(compiler::Assembler* assembler,
Register class_id_reg,
const CidRangeVector& cid_ranges,
compiler::Label* inside_range_lbl,
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
index d95dd98..1d5dd66 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
@@ -804,32 +804,6 @@
__ LoadClassId(class_id_reg, R0);
}
-#undef __
-#define __ assembler->
-
-int FlowGraphCompiler::EmitTestAndCallCheckCid(compiler::Assembler* assembler,
- compiler::Label* label,
- Register class_id_reg,
- const CidRangeValue& range,
- int bias,
- bool jump_on_miss) {
- intptr_t cid_start = range.cid_start;
- if (range.IsSingleCid()) {
- __ AddImmediateSetFlags(class_id_reg, class_id_reg, bias - cid_start);
- __ BranchIf(jump_on_miss ? NOT_ZERO : ZERO, label);
- bias = cid_start;
- } else {
- __ AddImmediate(class_id_reg, class_id_reg, bias - cid_start);
- __ CompareImmediate(class_id_reg, range.Extent());
- __ BranchIf(jump_on_miss ? UNSIGNED_GREATER : UNSIGNED_LESS_EQUAL, label);
- bias = cid_start;
- }
- return bias;
-}
-
-#undef __
-#define __ assembler()->
-
void FlowGraphCompiler::EmitMove(Location destination,
Location source,
TemporaryRegisterAllocator* allocator) {
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
index abad72a..1ccb222 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
@@ -814,32 +814,6 @@
__ LoadClassId(class_id_reg, R0);
}
-#undef __
-#define __ assembler->
-
-int FlowGraphCompiler::EmitTestAndCallCheckCid(compiler::Assembler* assembler,
- compiler::Label* label,
- Register class_id_reg,
- const CidRangeValue& range,
- int bias,
- bool jump_on_miss) {
- const intptr_t cid_start = range.cid_start;
- if (range.IsSingleCid()) {
- __ AddImmediateSetFlags(class_id_reg, class_id_reg, bias - cid_start);
- __ BranchIf(jump_on_miss ? NOT_EQUAL : EQUAL, label);
- bias = cid_start;
- } else {
- __ AddImmediate(class_id_reg, bias - cid_start);
- bias = cid_start;
- __ CompareImmediate(class_id_reg, range.Extent());
- __ BranchIf(jump_on_miss ? UNSIGNED_GREATER : UNSIGNED_LESS_EQUAL, label);
- }
- return bias;
-}
-
-#undef __
-#define __ assembler()->
-
void FlowGraphCompiler::EmitMove(Location destination,
Location source,
TemporaryRegisterAllocator* allocator) {
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc b/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
index 5ff3e51..9ed25de 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc
@@ -808,31 +808,6 @@
__ LoadClassId(class_id_reg, EAX);
}
-#undef __
-#define __ assembler->
-
-int FlowGraphCompiler::EmitTestAndCallCheckCid(compiler::Assembler* assembler,
- compiler::Label* label,
- Register class_id_reg,
- const CidRangeValue& range,
- int bias,
- bool jump_on_miss) {
- intptr_t cid_start = range.cid_start;
- if (range.IsSingleCid()) {
- __ cmpl(class_id_reg, compiler::Immediate(cid_start - bias));
- __ j(jump_on_miss ? NOT_EQUAL : EQUAL, label);
- } else {
- __ addl(class_id_reg, compiler::Immediate(bias - cid_start));
- bias = cid_start;
- __ cmpl(class_id_reg, compiler::Immediate(range.Extent()));
- __ j(jump_on_miss ? ABOVE : BELOW_EQUAL, label); // Unsigned higher.
- }
- return bias;
-}
-
-#undef __
-#define __ assembler()->
-
void FlowGraphCompiler::EmitMove(Location destination,
Location source,
TemporaryRegisterAllocator* tmp) {
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_riscv.cc b/runtime/vm/compiler/backend/flow_graph_compiler_riscv.cc
index 6abae73..b89c53f 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_riscv.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_riscv.cc
@@ -771,36 +771,6 @@
__ LoadClassId(class_id_reg, A0);
}
-#undef __
-#define __ assembler->
-
-int FlowGraphCompiler::EmitTestAndCallCheckCid(compiler::Assembler* assembler,
- compiler::Label* label,
- Register class_id_reg,
- const CidRangeValue& range,
- int bias,
- bool jump_on_miss) {
- const intptr_t cid_start = range.cid_start;
- if (range.IsSingleCid()) {
- __ AddImmediate(class_id_reg, class_id_reg, bias - cid_start);
- if (jump_on_miss) {
- __ bnez(class_id_reg, label);
- } else {
- __ beqz(class_id_reg, label);
- }
- bias = cid_start;
- } else {
- __ AddImmediate(class_id_reg, class_id_reg, bias - cid_start);
- bias = cid_start;
- __ CompareImmediate(class_id_reg, range.Extent());
- __ BranchIf(jump_on_miss ? UNSIGNED_GREATER : UNSIGNED_LESS_EQUAL, label);
- }
- return bias;
-}
-
-#undef __
-#define __ assembler()->
-
void FlowGraphCompiler::EmitMove(Location destination,
Location source,
TemporaryRegisterAllocator* allocator) {
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
index 43ce96a..5ef22a0 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc
@@ -781,34 +781,6 @@
__ LoadClassId(class_id_reg, RAX);
}
-#undef __
-#define __ assembler->
-
-int FlowGraphCompiler::EmitTestAndCallCheckCid(compiler::Assembler* assembler,
- compiler::Label* label,
- Register class_id_reg,
- const CidRangeValue& range,
- int bias,
- bool jump_on_miss) {
- // Note of WARNING: Due to smaller instruction encoding we use the 32-bit
- // instructions on x64, which means the compare instruction has to be
- // 32-bit (since the subtraction instruction is as well).
- intptr_t cid_start = range.cid_start;
- if (range.IsSingleCid()) {
- __ cmpl(class_id_reg, compiler::Immediate(cid_start - bias));
- __ BranchIf(jump_on_miss ? NOT_EQUAL : EQUAL, label);
- } else {
- __ addl(class_id_reg, compiler::Immediate(bias - cid_start));
- bias = cid_start;
- __ cmpl(class_id_reg, compiler::Immediate(range.Extent()));
- __ BranchIf(jump_on_miss ? UNSIGNED_GREATER : UNSIGNED_LESS_EQUAL, label);
- }
- return bias;
-}
-
-#undef __
-#define __ assembler()->
-
void FlowGraphCompiler::EmitMove(Location destination,
Location source,
TemporaryRegisterAllocator* tmp) {
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 51996c9..65a9afb 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -201,7 +201,9 @@
CidRange() : cid_start(kIllegalCid), cid_end(kIllegalCid) {}
bool IsSingleCid() const { return cid_start == cid_end; }
- bool Contains(intptr_t cid) { return cid_start <= cid && cid <= cid_end; }
+ bool Contains(intptr_t cid) const {
+ return cid_start <= cid && cid <= cid_end;
+ }
int32_t Extent() const { return cid_end - cid_start; }
// The number of class ids this range covers.
@@ -224,7 +226,9 @@
: cid_start(other.cid_start), cid_end(other.cid_end) {}
bool IsSingleCid() const { return cid_start == cid_end; }
- bool Contains(intptr_t cid) { return cid_start <= cid && cid <= cid_end; }
+ bool Contains(intptr_t cid) const {
+ return cid_start <= cid && cid <= cid_end;
+ }
int32_t Extent() const { return cid_end - cid_start; }
// The number of class ids this range covers.
@@ -244,6 +248,18 @@
typedef MallocGrowableArray<CidRangeValue> CidRangeVector;
+class CidRangeVectorUtils : public AllStatic {
+ public:
+ static bool ContainsCid(const CidRangeVector& ranges, intptr_t cid) {
+ for (const CidRangeValue& range : ranges) {
+ if (range.Contains(cid)) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
+
class HierarchyInfo : public ThreadStackResource {
public:
explicit HierarchyInfo(Thread* thread)
diff --git a/runtime/vm/type_testing_stubs.cc b/runtime/vm/type_testing_stubs.cc
index 7ff72b1..41ac9d1 100644
--- a/runtime/vm/type_testing_stubs.cc
+++ b/runtime/vm/type_testing_stubs.cc
@@ -573,15 +573,15 @@
// type. Falls through or jumps to check_succeeded if the range contains the
// cid, else jumps to check_failed.
//
-// Clobbers class_id_reg.
-void TypeTestingStubGenerator::BuildOptimizedSubtypeRangeCheck(
+// Returns whether class_id_reg is clobbered.
+bool TypeTestingStubGenerator::BuildOptimizedSubtypeRangeCheck(
compiler::Assembler* assembler,
const CidRangeVector& ranges,
Register class_id_reg,
compiler::Label* check_succeeded,
compiler::Label* check_failed) {
CommentCheckedClasses(assembler, ranges);
- FlowGraphCompiler::GenerateCidRangesCheck(
+ return FlowGraphCompiler::GenerateCidRangesCheck(
assembler, class_id_reg, ranges, check_succeeded, check_failed, true);
}
@@ -897,13 +897,31 @@
CidRangeVector cid_checks_only, type_argument_checks, not_checked;
SplitOnTypeArgumentTests(hi, type, type_class, ranges, &cid_checks_only,
&type_argument_checks, ¬_checked);
+ ASSERT(!CidRangeVectorUtils::ContainsCid(type_argument_checks, kSmiCid));
+ const bool smi_valid =
+ CidRangeVectorUtils::ContainsCid(cid_checks_only, kSmiCid);
+ // If we'll generate any cid checks and Smi isn't a valid subtype, then
+ // do a single Smi check here, since each generated check requires a fresh
+ // load of the class id. Otherwise, we'll generate the Smi check as part of
+ // the cid checks only block.
+ if (!smi_valid &&
+ (!cid_checks_only.is_empty() || !type_argument_checks.is_empty())) {
+ __ BranchIfSmi(TypeTestABI::kInstanceReg, load_failed);
+ }
+ // Ensure that if the cid checks only block is skipped, the first iteration
+ // of the type arguments check will generate a cid load.
+ bool cid_needs_reload = true;
if (!cid_checks_only.is_empty()) {
compiler::Label is_subtype, keep_looking;
compiler::Label* check_failed =
type_argument_checks.is_empty() ? load_failed : &keep_looking;
- __ LoadClassIdMayBeSmi(class_id_reg, TypeTestABI::kInstanceReg);
- BuildOptimizedSubtypeRangeCheck(assembler, cid_checks_only, class_id_reg,
- &is_subtype, check_failed);
+ if (smi_valid) {
+ __ LoadClassIdMayBeSmi(class_id_reg, TypeTestABI::kInstanceReg);
+ } else {
+ __ LoadClassId(class_id_reg, TypeTestABI::kInstanceReg);
+ }
+ cid_needs_reload = BuildOptimizedSubtypeRangeCheck(
+ assembler, cid_checks_only, class_id_reg, &is_subtype, check_failed);
__ Bind(&is_subtype);
__ Ret();
__ Bind(&keep_looking);
@@ -929,9 +947,11 @@
// and avoid emitting a jump to load_succeeded.
compiler::Label* check_failed =
i < vectors.length() - 1 ? &keep_looking : load_failed;
- __ LoadClassIdMayBeSmi(class_id_reg, TypeTestABI::kInstanceReg);
- BuildOptimizedSubtypeRangeCheck(assembler, *vector, class_id_reg,
- &load_tav, check_failed);
+ if (cid_needs_reload) {
+ __ LoadClassId(class_id_reg, TypeTestABI::kInstanceReg);
+ }
+ cid_needs_reload = BuildOptimizedSubtypeRangeCheck(
+ assembler, *vector, class_id_reg, &load_tav, check_failed);
__ Bind(&load_tav);
__ LoadCompressedFieldFromOffset(instance_type_args_reg,
TypeTestABI::kInstanceReg, tav_offset);
diff --git a/runtime/vm/type_testing_stubs.h b/runtime/vm/type_testing_stubs.h
index 5775b53..7807bc1 100644
--- a/runtime/vm/type_testing_stubs.h
+++ b/runtime/vm/type_testing_stubs.h
@@ -71,7 +71,7 @@
const Type& type,
const Class& type_class);
- static void BuildOptimizedSubtypeRangeCheck(compiler::Assembler* assembler,
+ static bool BuildOptimizedSubtypeRangeCheck(compiler::Assembler* assembler,
const CidRangeVector& ranges,
Register class_id_reg,
compiler::Label* check_succeeded,
diff --git a/sdk/lib/_internal/wasm/lib/internal_patch.dart b/sdk/lib/_internal/wasm/lib/internal_patch.dart
index 444a8ad..b6e9a14 100644
--- a/sdk/lib/_internal/wasm/lib/internal_patch.dart
+++ b/sdk/lib/_internal/wasm/lib/internal_patch.dart
@@ -84,6 +84,14 @@
// Important: this is unsafe and must be used with care.
external T unsafeCast<T>(Object? v);
+// A version of [unsafeCast] that is opaque to the TFA. The TFA knows about the
+// [unsafeCast] function and will sharpen the result type with the inferred type
+// of the input. When such sharpening is undesirable, this function should be
+// used. One such situation is when either the source or destination type is not
+// an ordinary Dart type, for instance if it is one of the special Wasm types
+// from wasm_types.dart.
+external T unsafeCastOpaque<T>(Object? v);
+
// This function can be used to keep an object alive till that point.
void reachabilityFence(Object? object) {}
diff --git a/sdk/lib/libraries.json b/sdk/lib/libraries.json
index 4fea98b..dae53f7 100644
--- a/sdk/lib/libraries.json
+++ b/sdk/lib/libraries.json
@@ -222,7 +222,6 @@
"_internal/vm/lib/ffi_patch.dart",
"_internal/vm/lib/ffi_allocation_patch.dart",
"_internal/vm/lib/ffi_dynamic_library_patch.dart",
- "_internal/vm/lib/ffi_native_finalizer_patch.dart",
"_internal/vm/lib/ffi_native_type_patch.dart",
"_internal/vm/lib/ffi_struct_patch.dart"
]
diff --git a/sdk/lib/libraries.yaml b/sdk/lib/libraries.yaml
index 8f4b22a..ca10300 100644
--- a/sdk/lib/libraries.yaml
+++ b/sdk/lib/libraries.yaml
@@ -210,7 +210,6 @@
- "_internal/vm/lib/ffi_patch.dart"
- "_internal/vm/lib/ffi_allocation_patch.dart"
- "_internal/vm/lib/ffi_dynamic_library_patch.dart"
- - "_internal/vm/lib/ffi_native_finalizer_patch.dart"
- "_internal/vm/lib/ffi_native_type_patch.dart"
- "_internal/vm/lib/ffi_struct_patch.dart"
nativewrappers:
diff --git a/tools/VERSION b/tools/VERSION
index a1f8f84..082415f 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 251
+PRERELEASE 252
PRERELEASE_PATCH 0
\ No newline at end of file