Version 2.17.0-260.0.dev
Merge commit 'e8a56690bbfa46a67da4216dc7e5bf245f559eea' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e7b432..cb298a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -74,6 +74,10 @@
- Deprecate `SecureSocket.renegotiate` and `RawSecureSocket.renegotiate`,
which were no-ops.
+- **Breaking Change** [#48513](https://github.com/dart-lang/sdk/issues/48513):
+ Add a new `allowLegacyUnsafeRenegotiation` poperty to `SecurityContext`,
+ which allows TLS renegotiation for client secure sockets.
+
#### `dart:isolate`
- Add `Isolate.run` to run a function in a new isolate.
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 a0e094b..e19c27a 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
@@ -493,6 +493,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,
@@ -508,6 +509,7 @@
declaredContextType: declaredContextType,
runtimeCheckedType: runtimeCheckedType,
isVoidAllowed: isVoidAllowed,
+ coerceExpression: coerceExpression,
errorTemplate: errorTemplate,
nullabilityErrorTemplate: nullabilityErrorTemplate,
nullabilityNullErrorTemplate: nullabilityNullErrorTemplate,
@@ -526,6 +528,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,
@@ -577,7 +580,8 @@
contextType, inferenceResult.inferredType,
isNonNullableByDefault: isNonNullableByDefault,
isVoidAllowed: isVoidAllowed,
- isExpressionTypePrecise: preciseTypeErrorTemplate != null);
+ isExpressionTypePrecise: preciseTypeErrorTemplate != null,
+ coerceExpression: coerceExpression);
if (assignabilityResult.needsTearOff) {
TypedTearoff typedTearoff = _tearOffCall(inferenceResult.expression,
@@ -781,7 +785,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
@@ -793,7 +798,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);
@@ -812,7 +817,7 @@
}
}
ImplicitInstantiation? implicitInstantiation;
- if (libraryBuilder.enableConstructorTearOffsInLibrary) {
+ if (coerceExpression && libraryBuilder.enableConstructorTearOffsInLibrary) {
implicitInstantiation =
computeImplicitInstantiation(expressionType, contextType);
if (implicitInstantiation != null) {
@@ -866,8 +871,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);
}
@@ -2617,17 +2629,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/crashing_test_case_minimizer_impl.dart b/pkg/front_end/test/crashing_test_case_minimizer_impl.dart
index e6ffb2b..8b716eb 100644
--- a/pkg/front_end/test/crashing_test_case_minimizer_impl.dart
+++ b/pkg/front_end/test/crashing_test_case_minimizer_impl.dart
@@ -290,7 +290,7 @@
// For all dart files: Parse them as set their source as the parsed source
// to "get around" any encoding issues when printing later.
- Map<Uri, Uint8List> copy = new Map.from(_fs.data);
+ Map<Uri?, Uint8List?> copy = new Map.of(_fs.data);
for (Uri? uri in _fs.data.keys) {
if (await _shouldQuit()) break;
String uriString = uri.toString();
@@ -726,7 +726,7 @@
// TODO(jensj): don't use full uris.
print("""
-# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+# 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.md file.
@@ -910,7 +910,7 @@
// Check if there now are any unused files.
if (_latestComponent == null) return;
Set<Uri> neededUris = _latestComponent!.uriToSource.keys.toSet();
- Map<Uri, Uint8List> copy = new Map.from(_fs.data);
+ Map<Uri?, Uint8List?> copy = new Map.of(_fs.data);
bool removedSome = false;
if (await _shouldQuit()) return;
for (MapEntry<Uri?, Uint8List?> entry in _fs.data.entries) {
@@ -947,7 +947,7 @@
if (!limitTo1) {
if (await _shouldQuit()) return;
- Map<Uri, Uint8List> copy = new Map.from(_fs.data);
+ Map<Uri?, Uint8List?> copy = new Map.of(_fs.data);
// Try to remove content of i and the next 9 (10 files in total).
for (int j = uriIndex; j < uriIndex + 10 && j < uris.length; j++) {
Uri uri = uris[j];
@@ -1223,7 +1223,7 @@
// Try to load json and remove blocks.
try {
Map json = jsonDecode(utf8.decode(data));
- Map jsonModified = new Map.from(json);
+ Map jsonModified = new Map.of(json);
List packages = json["packages"];
List packagesModified = new List.from(packages);
jsonModified["packages"] = packagesModified;
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/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 6eddb5a..4d2dad3 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -137,6 +137,7 @@
V(SecurityContext_SetClientAuthoritiesBytes, 3) \
V(SecurityContext_SetTrustedCertificatesBytes, 3) \
V(SecurityContext_TrustBuiltinRoots, 1) \
+ V(SecurityContext_SetAllowTlsRenegotiation, 2) \
V(SecurityContext_UseCertificateChainBytes, 3) \
V(ServerSocket_Accept, 2) \
V(ServerSocket_CreateBindListen, 7) \
diff --git a/runtime/bin/secure_socket_filter.cc b/runtime/bin/secure_socket_filter.cc
index 9e1492e..a78b635 100644
--- a/runtime/bin/secure_socket_filter.cc
+++ b/runtime/bin/secure_socket_filter.cc
@@ -504,6 +504,10 @@
SSL_set_bio(ssl_, ssl_side, ssl_side);
SSL_set_mode(ssl_, SSL_MODE_AUTO_RETRY); // TODO(whesse): Is this right?
SSL_set_ex_data(ssl_, filter_ssl_index, this);
+
+ if (context->allow_tls_renegotiation()) {
+ SSL_set_renegotiate_mode(ssl_, ssl_renegotiate_freely);
+ }
context->RegisterCallbacks(ssl_);
SSL_set_ex_data(ssl_, ssl_cert_context_index, context);
diff --git a/runtime/bin/secure_socket_unsupported.cc b/runtime/bin/secure_socket_unsupported.cc
index f64203d..5d5241db 100644
--- a/runtime/bin/secure_socket_unsupported.cc
+++ b/runtime/bin/secure_socket_unsupported.cc
@@ -130,6 +130,12 @@
"Secure Sockets unsupported on this platform"));
}
+void FUNCTION_NAME(SecurityContext_SetAllowTlsRenegotiation)(
+ Dart_NativeArguments args) {
+ Dart_ThrowException(DartUtils::NewDartArgumentError(
+ "Secure Sockets unsupported on this platform"));
+}
+
void FUNCTION_NAME(SecurityContext_UseCertificateChainBytes)(
Dart_NativeArguments args) {
Dart_ThrowException(DartUtils::NewDartArgumentError(
diff --git a/runtime/bin/security_context.cc b/runtime/bin/security_context.cc
index 8ccc6a3..b59212e 100644
--- a/runtime/bin/security_context.cc
+++ b/runtime/bin/security_context.cc
@@ -877,6 +877,22 @@
context->TrustBuiltinRoots();
}
+void FUNCTION_NAME(SecurityContext_SetAllowTlsRenegotiation)(
+ Dart_NativeArguments args) {
+ SSLCertContext* context = SSLCertContext::GetSecurityContext(args);
+ Dart_Handle allow_tls_handle = ThrowIfError(Dart_GetNativeArgument(args, 1));
+
+ ASSERT(context != NULL);
+ ASSERT(allow_tls_handle != NULL);
+
+ if (!Dart_IsBoolean(allow_tls_handle)) {
+ Dart_ThrowException(DartUtils::NewDartArgumentError(
+ "Non-boolean argument passed to SetAllowTlsRenegotiation"));
+ }
+ bool allow = DartUtils::GetBooleanValue(allow_tls_handle);
+ context->set_allow_tls_renegotiation(allow);
+}
+
void FUNCTION_NAME(X509_Der)(Dart_NativeArguments args) {
Dart_SetReturnValue(args, X509Helper::GetDer(args));
}
diff --git a/runtime/bin/security_context.h b/runtime/bin/security_context.h
index b5bc66b..a9eec35 100644
--- a/runtime/bin/security_context.h
+++ b/runtime/bin/security_context.h
@@ -31,7 +31,8 @@
: ReferenceCounted(),
context_(context),
alpn_protocol_string_(nullptr),
- trust_builtin_(false) {}
+ trust_builtin_(false),
+ allow_tls_renegotiation_(false) {}
~SSLCertContext() {
SSL_CTX_free(context_);
@@ -82,6 +83,11 @@
bool trust_builtin() const { return trust_builtin_; }
+ void set_allow_tls_renegotiation(bool allow) {
+ allow_tls_renegotiation_ = allow;
+ }
+ bool allow_tls_renegotiation() const { return allow_tls_renegotiation_; }
+
void set_trust_builtin(bool trust_builtin) { trust_builtin_ = trust_builtin; }
void RegisterCallbacks(SSL* ssl);
@@ -112,7 +118,7 @@
uint8_t* alpn_protocol_string_;
bool trust_builtin_;
-
+ bool allow_tls_renegotiation_;
static bool long_ssl_cert_evaluation_;
static bool bypass_trusting_system_roots_;
diff --git a/sdk/lib/_internal/vm/bin/secure_socket_patch.dart b/sdk/lib/_internal/vm/bin/secure_socket_patch.dart
index 680adcf..bfdc6bd 100644
--- a/sdk/lib/_internal/vm/bin/secure_socket_patch.dart
+++ b/sdk/lib/_internal/vm/bin/secure_socket_patch.dart
@@ -209,6 +209,8 @@
class _SecurityContext extends NativeFieldWrapperClass1
implements SecurityContext {
+ bool _allowLegacyUnsafeRenegotiation = false;
+
_SecurityContext(bool withTrustedRoots) {
_createNativeContext();
if (withTrustedRoots) {
@@ -216,6 +218,13 @@
}
}
+ set allowLegacyUnsafeRenegotiation(bool allow) {
+ _allowLegacyUnsafeRenegotiation = allow;
+ _setAllowTlsRenegotiation(allow);
+ }
+
+ bool get allowLegacyUnsafeRenegotiation => _allowLegacyUnsafeRenegotiation;
+
@pragma("vm:external-name", "SecurityContext_Allocate")
external void _createNativeContext();
@@ -266,6 +275,8 @@
external void _setAlpnProtocols(Uint8List protocols, bool isServer);
@pragma("vm:external-name", "SecurityContext_TrustBuiltinRoots")
external void _trustBuiltinRoots();
+ @pragma("vm:external-name", "SecurityContext_SetAllowTlsRenegotiation")
+ external void _setAllowTlsRenegotiation(bool allow);
}
/**
diff --git a/sdk/lib/io/security_context.dart b/sdk/lib/io/security_context.dart
index d041975..8e9839e 100644
--- a/sdk/lib/io/security_context.dart
+++ b/sdk/lib/io/security_context.dart
@@ -160,6 +160,16 @@
/// or client connections.
void setAlpnProtocols(List<String> protocols, bool isServer);
+ /// If `true`, the [SecurityContext] will allow TLS renegotiation.
+ /// Renegotiation is only supported as a client and the HelloRequest must be
+ /// received at a quiet point in the application protocol. This is sufficient
+ /// to support the legacy use case of requesting a new client certificate
+ /// between an HTTP request and response in (unpipelined) HTTP/1.1.
+ /// NOTE: Renegotiation is an extremely problematic protocol feature and
+ /// should only be used to communicate with legacy servers in environments
+ /// where it is known to be safe.
+ abstract bool allowLegacyUnsafeRenegotiation;
+
/// Encodes a set of supported protocols for ALPN/NPN usage.
///
/// The [protocols] list is expected to contain protocols in descending order
diff --git a/tests/standalone/io/secure_socket_allow_renegotiation_test.dart b/tests/standalone/io/secure_socket_allow_renegotiation_test.dart
new file mode 100644
index 0000000..f2f5716
--- /dev/null
+++ b/tests/standalone/io/secure_socket_allow_renegotiation_test.dart
@@ -0,0 +1,81 @@
+// 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.
+//
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+//
+// It is not possible to initiate TLS-renegotiation from a pure-Dart server so
+// just test that the `allowLegacyUnsafeRenegotiation` in `SecurityContext`
+// does not affect connections that do *not* do renegotiation.
+
+import "dart:async";
+import 'dart:convert';
+import "dart:io";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
+late InternetAddress HOST;
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+ ..useCertificateChain(localFile('certificates/server_chain.pem'))
+ ..usePrivateKey(localFile('certificates/server_key.pem'),
+ password: 'dartdart');
+
+Future<SecureServerSocket> startEchoServer() {
+ return SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+ server.listen((SecureSocket client) {
+ client.fold<List<int>>(
+ <int>[], (message, data) => message..addAll(data)).then((message) {
+ client.add(message);
+ client.close();
+ });
+ });
+ return server;
+ });
+}
+
+testSuccess(SecureServerSocket server) async {
+ // NOTE: this test only verifies that `allowLegacyUnsafeRenegotiation` does
+ // not cause incorrect behavior when enabled - the server does *not* actually
+ // trigger TLS renegotiation.
+ SecurityContext clientContext = new SecurityContext()
+ ..allowLegacyUnsafeRenegotiation = true
+ ..setTrustedCertificates(localFile('certificates/trusted_certs.pem'));
+
+ await SecureSocket.connect(HOST, server.port, context: clientContext)
+ .then((socket) async {
+ socket.write("Hello server.");
+ socket.close();
+ Expect.isTrue(await utf8.decoder.bind(socket).contains("Hello server."));
+ });
+}
+
+testProperty() {
+ SecurityContext context = new SecurityContext();
+ Expect.isFalse(context.allowLegacyUnsafeRenegotiation);
+ context.allowLegacyUnsafeRenegotiation = true;
+ Expect.isTrue(context.allowLegacyUnsafeRenegotiation);
+ context.allowLegacyUnsafeRenegotiation = false;
+ Expect.isFalse(context.allowLegacyUnsafeRenegotiation);
+}
+
+void main() async {
+ asyncStart();
+ await InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first);
+ final server = await startEchoServer();
+
+ await testSuccess(server);
+ testProperty();
+
+ await server.close();
+ asyncEnd();
+}
diff --git a/tests/standalone_2/io/secure_socket_allow_renegotiation_test.dart b/tests/standalone_2/io/secure_socket_allow_renegotiation_test.dart
new file mode 100644
index 0000000..16790e1
--- /dev/null
+++ b/tests/standalone_2/io/secure_socket_allow_renegotiation_test.dart
@@ -0,0 +1,83 @@
+// 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.
+//
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+// OtherResources=certificates/server_chain.pem
+// OtherResources=certificates/server_key.pem
+// OtherResources=certificates/trusted_certs.pem
+//
+// It is not possible to initiate TLS-renegotiation from a pure-Dart server so
+// just test that the `allowLegacyUnsafeRenegotiation` in `SecurityContext`
+// does not affect connections that do *not* do renegotiation.
+
+// @dart = 2.9
+
+import "dart:async";
+import 'dart:convert';
+import "dart:io";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
+InternetAddress HOST;
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+ ..useCertificateChain(localFile('certificates/server_chain.pem'))
+ ..usePrivateKey(localFile('certificates/server_key.pem'),
+ password: 'dartdart');
+
+Future<SecureServerSocket> startEchoServer() {
+ return SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+ server.listen((SecureSocket client) {
+ client.fold<List<int>>(
+ <int>[], (message, data) => message..addAll(data)).then((message) {
+ client.add(message);
+ client.close();
+ });
+ });
+ return server;
+ });
+}
+
+testSuccess(SecureServerSocket server) async {
+ // NOTE: this test only verifies that `allowLegacyUnsafeRenegotiation` does
+ // not cause incorrect behavior when enabled - the server does *not* actually
+ // trigger TLS renegotiation.
+ SecurityContext clientContext = new SecurityContext()
+ ..allowLegacyUnsafeRenegotiation = true
+ ..setTrustedCertificates(localFile('certificates/trusted_certs.pem'));
+
+ await SecureSocket.connect(HOST, server.port, context: clientContext)
+ .then((socket) async {
+ socket.write("Hello server.");
+ socket.close();
+ Expect.isTrue(await utf8.decoder.bind(socket).contains("Hello server."));
+ });
+}
+
+testProperty() {
+ SecurityContext context = new SecurityContext();
+ Expect.isFalse(context.allowLegacyUnsafeRenegotiation);
+ context.allowLegacyUnsafeRenegotiation = true;
+ Expect.isTrue(context.allowLegacyUnsafeRenegotiation);
+ context.allowLegacyUnsafeRenegotiation = false;
+ Expect.isFalse(context.allowLegacyUnsafeRenegotiation);
+}
+
+void main() async {
+ asyncStart();
+ await InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first);
+ final server = await startEchoServer();
+
+ await testSuccess(server);
+ testProperty();
+
+ await server.close();
+ asyncEnd();
+}
diff --git a/tools/VERSION b/tools/VERSION
index 0bf68a5..743ffed 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 17
PATCH 0
-PRERELEASE 259
+PRERELEASE 260
PRERELEASE_PATCH 0
\ No newline at end of file