Version 2.12.0-112.0.dev
Merge commit '442fa7f44e52b1323ecbcae0db18c4bed9146e34' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
index a8bac9f..9752d91 100644
--- a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
@@ -1286,9 +1286,6 @@
/// variable that is no longer in scope.
final Map<Variable, VariableModel<Variable, Type> /*!*/ > variableInfo;
- /// Variable model for variables that have never been seen before.
- final VariableModel<Variable, Type> _freshVariableInfo;
-
/// The empty map, used to [join] variables.
final Map<Variable, VariableModel<Variable, Type>> _emptyVariableMap = {};
@@ -1302,8 +1299,7 @@
);
@visibleForTesting
- FlowModel.withInfo(this.reachable, this.variableInfo)
- : _freshVariableInfo = new VariableModel.fresh() {
+ FlowModel.withInfo(this.reachable, this.variableInfo) {
assert(reachable != null);
assert(() {
for (VariableModel<Variable, Type> value in variableInfo.values) {
@@ -1376,17 +1372,15 @@
/// A local variable is [initialized] if its declaration has an initializer.
/// A function parameter is always initialized, so [initialized] is `true`.
FlowModel<Variable, Type> declare(Variable variable, bool initialized) {
- VariableModel<Variable, Type> newInfoForVar = _freshVariableInfo;
- if (initialized) {
- newInfoForVar = newInfoForVar.initialize();
- }
+ VariableModel<Variable, Type> newInfoForVar =
+ new VariableModel.fresh(assigned: initialized);
return _updateVariableInfo(variable, newInfoForVar);
}
/// Gets the info for the given [variable], creating it if it doesn't exist.
VariableModel<Variable, Type> infoFor(Variable variable) =>
- variableInfo[variable] ?? _freshVariableInfo;
+ variableInfo[variable] ?? new VariableModel.fresh();
/// Builds a [FlowModel] based on `this`, but extending the `tested` set to
/// include types from [other]. This is used at the bottom of certain kinds
@@ -2060,11 +2054,10 @@
/// Creates a [VariableModel] representing a variable that's never been seen
/// before.
- VariableModel.fresh()
+ VariableModel.fresh({this.assigned = false})
: promotedTypes = null,
tested = const [],
- assigned = false,
- unassigned = true,
+ unassigned = !assigned,
writeCaptured = false;
/// Returns a new [VariableModel] in which any promotions present have been
@@ -2077,16 +2070,6 @@
null, tested, assigned, false, writeCaptured);
}
- /// Returns a new [VariableModel] reflecting the fact that the variable was
- /// just initialized.
- VariableModel<Variable, Type> initialize() {
- if (promotedTypes == null && tested.isEmpty && assigned && !unassigned) {
- return this;
- }
- return new VariableModel<Variable, Type>(
- null, const [], true, false, writeCaptured);
- }
-
/// Returns an updated model reflect a control path that is known to have
/// previously passed through some [other] state. See [FlowModel.restrict]
/// for details.
diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
index 64581cce..f7adca0 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart
@@ -3936,7 +3936,9 @@
Message Function(
String name, DartType _type, bool isNonNullableByDefault)>(
messageTemplate:
- r"""Optional parameter '#name' should have a default value because its type '#type' doesn't allow null.""",
+ r"""The parameter '#name' can't have a value of 'null' because of its type '#type', but the implicit default value is 'null'.""",
+ tipTemplate:
+ r"""Try adding either an explicit non-'null' default value or the 'required' modifier.""",
withArguments:
_withArgumentsOptionalNonNullableWithoutInitializerError);
@@ -3945,11 +3947,11 @@
Message Function(
String name, DartType _type, bool isNonNullableByDefault)>
codeOptionalNonNullableWithoutInitializerError = const Code<
- Message Function(
- String name, DartType _type, bool isNonNullableByDefault)>(
- "OptionalNonNullableWithoutInitializerError",
- templateOptionalNonNullableWithoutInitializerError,
-);
+ Message Function(
+ String name, DartType _type, bool isNonNullableByDefault)>(
+ "OptionalNonNullableWithoutInitializerError",
+ templateOptionalNonNullableWithoutInitializerError,
+ analyzerCodes: <String>["MISSING_DEFAULT_VALUE_FOR_PARAMETER"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsOptionalNonNullableWithoutInitializerError(
@@ -3961,8 +3963,9 @@
String type = typeParts.join();
return new Message(codeOptionalNonNullableWithoutInitializerError,
message:
- """Optional parameter '${name}' should have a default value because its type '${type}' doesn't allow null.""" +
+ """The parameter '${name}' can't have a value of 'null' because of its type '${type}', but the implicit default value is 'null'.""" +
labeler.originMessages,
+ tip: """Try adding either an explicit non-'null' default value or the 'required' modifier.""",
arguments: {'name': name, 'type': _type});
}
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index 2fe29ec..2350d4d 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -629,8 +629,6 @@
OperatorParameterMismatch2/example: Fail
OperatorWithOptionalFormals/analyzerCode: Fail
OperatorWithOptionalFormals/example: Fail
-OptionalNonNullableWithoutInitializerError/analyzerCode: Fail
-OptionalNonNullableWithoutInitializerWarning/analyzerCode: Fail
OverrideFewerNamedArguments/example: Fail
OverrideFewerPositionalArguments/example: Fail
OverrideMismatchNamedParameter/example: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index ae4a9e7..96f20a7 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -4585,7 +4585,9 @@
template: "Required named parameter '#name' must be provided."
OptionalNonNullableWithoutInitializerError:
- template: "Optional parameter '#name' should have a default value because its type '#type' doesn't allow null."
+ template: "The parameter '#name' can't have a value of 'null' because of its type '#type', but the implicit default value is 'null'."
+ tip: "Try adding either an explicit non-'null' default value or the 'required' modifier."
+ analyzerCode: MISSING_DEFAULT_VALUE_FOR_PARAMETER
configuration: nnbd-strong
script:
- method1({int a}) {}
diff --git a/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.outline.expect b/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.outline.expect
index 7171bac..e60e513 100644
--- a/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.outline.expect
+++ b/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.outline.expect
@@ -22,7 +22,8 @@
// const Class.method(T t) : this(-t);
// ^
//
-// pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: Optional parameter 'named' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: The parameter 'named' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// int procedure(int i, {int named}) => i;
// ^^^^^
//
diff --git a/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.expect b/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.expect
index aa1a131..8f2590a 100644
--- a/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.expect
+++ b/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.expect
@@ -22,7 +22,8 @@
// const Class.method(T t) : this(-t);
// ^
//
-// pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: Optional parameter 'named' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: The parameter 'named' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// int procedure(int i, {int named}) => i;
// ^^^^^
//
diff --git a/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.transformed.expect b/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.transformed.expect
index 9d5946b..858bb47 100644
--- a/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart.strong.transformed.expect
@@ -22,7 +22,8 @@
// const Class.method(T t) : this(-t);
// ^
//
-// pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: Optional parameter 'named' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/general/constants/with_unevaluated_agnostic/various.dart:123:27: Error: The parameter 'named' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// int procedure(int i, {int named}) => i;
// ^^^^^
//
diff --git a/pkg/front_end/testcases/nnbd/issue40954.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue40954.dart.outline.expect
index c6641b9..35e6233 100644
--- a/pkg/front_end/testcases/nnbd/issue40954.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue40954.dart.outline.expect
@@ -2,33 +2,39 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test2(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test11(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test22(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test2(var v, {A a}) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue40954.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue40954.dart.strong.expect
index e94c384..cbfe037 100644
--- a/pkg/front_end/testcases/nnbd/issue40954.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/issue40954.dart.strong.expect
@@ -2,33 +2,39 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test2(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test11(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test22(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test2(var v, {A a}) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue40954.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue40954.dart.strong.transformed.expect
index e94c384..cbfe037 100644
--- a/pkg/front_end/testcases/nnbd/issue40954.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue40954.dart.strong.transformed.expect
@@ -2,33 +2,39 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test2(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test11(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test22(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test2(var v, {A a}) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue40954.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue40954.dart.weak.expect
index e94c384..cbfe037 100644
--- a/pkg/front_end/testcases/nnbd/issue40954.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/issue40954.dart.weak.expect
@@ -2,33 +2,39 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test2(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test11(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test22(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test2(var v, {A a}) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue40954.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue40954.dart.weak.transformed.expect
index e94c384..cbfe037 100644
--- a/pkg/front_end/testcases/nnbd/issue40954.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue40954.dart.weak.transformed.expect
@@ -2,33 +2,39 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:8:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:10:31: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// static void test2(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:12:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test11(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:14:25: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test22(var v, {A a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:17:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test1(var v, [A a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: Optional parameter 'a' should have a default value because its type 'A' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue40954.dart:19:22: Error: The parameter 'a' can't have a value of 'null' because of its type 'A', but the implicit default value is 'null'.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue40954.dart'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void test2(var v, {A a}) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue42362.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue42362.dart.outline.expect
index 36632a1..dbb74c3 100644
--- a/pkg/front_end/testcases/nnbd/issue42362.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue42362.dart.outline.expect
@@ -2,67 +2,83 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([int i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({int i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor3([int i]) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor4({int i}) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory8([int i]) => new A.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory9({int i}) => new A.constructor4(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor3([int i]) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor4({int i}) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory8([int i]) => new C.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory9({int i}) => new C.constructor4(); // error
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue42362.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue42362.dart.strong.expect
index 0f40eb2..327d48b 100644
--- a/pkg/front_end/testcases/nnbd/issue42362.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/issue42362.dart.strong.expect
@@ -2,67 +2,83 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([int i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({int i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor3([int i]) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor4({int i}) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory8([int i]) => new A.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory9({int i}) => new A.constructor4(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor3([int i]) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor4({int i}) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory8([int i]) => new C.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory9({int i}) => new C.constructor4(); // error
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue42362.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue42362.dart.strong.transformed.expect
index 2d7d920..d74b206 100644
--- a/pkg/front_end/testcases/nnbd/issue42362.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue42362.dart.strong.transformed.expect
@@ -2,67 +2,83 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([int i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({int i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor3([int i]) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor4({int i}) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory8([int i]) => new A.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory9({int i}) => new A.constructor4(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor3([int i]) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor4({int i}) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory8([int i]) => new C.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory9({int i}) => new C.constructor4(); // error
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue42362.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue42362.dart.weak.expect
index 0f40eb2..327d48b 100644
--- a/pkg/front_end/testcases/nnbd/issue42362.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/issue42362.dart.weak.expect
@@ -2,67 +2,83 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([int i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({int i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor3([int i]) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor4({int i}) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory8([int i]) => new A.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory9({int i}) => new A.constructor4(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor3([int i]) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor4({int i}) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory8([int i]) => new C.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory9({int i}) => new C.constructor4(); // error
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue42362.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue42362.dart.weak.transformed.expect
index 253c393..9e8520e 100644
--- a/pkg/front_end/testcases/nnbd/issue42362.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue42362.dart.weak.transformed.expect
@@ -2,67 +2,83 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:45:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([int i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:47:16: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({int i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:8:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:10:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:12:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor3([int i]) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:15:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// A.constructor4({int i}) // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:41:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory8([int i]) => new A.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:43:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory A.factory9({int i}) => new A.constructor4(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:106:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3([i]) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:108:12: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4({i}) {} // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:77:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor1([this.i]); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:79:24: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor2({this.i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:81:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor3([int i]) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:83:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.constructor4({int i}) : this.i = i; // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:102:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory8([int i]) => new C.constructor3(); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue42362.dart:104:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.factory9({int i}) => new C.constructor4(); // error
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue43276.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue43276.dart.outline.expect
index 9cbb91e..83d2e51 100644
--- a/pkg/front_end/testcases/nnbd/issue43276.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue43276.dart.outline.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.gen({int i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.fact({int i}) /* error */ {
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue43276.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue43276.dart.strong.expect
index dfcedf7..bcb7771 100644
--- a/pkg/front_end/testcases/nnbd/issue43276.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/issue43276.dart.strong.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.gen({int i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.fact({int i}) /* error */ {
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue43276.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/issue43276.dart.strong.transformed.expect
index ac206c0..744265d 100644
--- a/pkg/front_end/testcases/nnbd/issue43276.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue43276.dart.strong.transformed.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.gen({int i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.fact({int i}) /* error */ {
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue43276.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue43276.dart.weak.expect
index dfcedf7..bcb7771 100644
--- a/pkg/front_end/testcases/nnbd/issue43276.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/issue43276.dart.weak.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.gen({int i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.fact({int i}) /* error */ {
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/issue43276.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/issue43276.dart.weak.transformed.expect
index ac206c0..744265d 100644
--- a/pkg/front_end/testcases/nnbd/issue43276.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/issue43276.dart.weak.transformed.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:6:14: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// C.gen({int i}); // error
// ^
//
-// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/issue43276.dart:8:23: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// factory C.fact({int i}) /* error */ {
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.outline.expect b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.outline.expect
index f59fb9e..9089964 100644
--- a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.outline.expect
@@ -2,19 +2,23 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method1({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method2([int a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4([int a]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.expect b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.expect
index d869c59..f03bd13 100644
--- a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.expect
@@ -2,19 +2,23 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method1({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method2([int a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4([int a]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.transformed.expect
index d869c59..f03bd13 100644
--- a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.strong.transformed.expect
@@ -2,19 +2,23 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method1({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method2([int a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4([int a]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.expect b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.expect
index d869c59..f03bd13 100644
--- a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.expect
@@ -2,19 +2,23 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method1({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method2([int a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4([int a]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.transformed.expect
index d869c59..f03bd13 100644
--- a/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/non_nullable_optional.dart.weak.transformed.expect
@@ -2,19 +2,23 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method1({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional.dart:11:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method2([int a]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:7:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method3({int a}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/non_nullable_optional_part.dart:9:14: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// method4([int a]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.outline.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.outline.expect
index 6a9e27e..49eec30 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.outline.expect
@@ -10,27 +10,33 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect
index 9762f48..2d71c44 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.expect
@@ -12,27 +12,33 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect
index 9762f48..2d71c44 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.strong.transformed.expect
@@ -12,27 +12,33 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.expect
index 9762f48..2d71c44 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.expect
@@ -12,27 +12,33 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.transformed.expect
index 9762f48..2d71c44 100644
--- a/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/platform_optional_parameters/main.dart.weak.transformed.expect
@@ -12,27 +12,33 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:11:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:13:29: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:17:25: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void patchedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/patch_lib.dart:19:27: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void _injectedMethod([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:6:20: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/platform_optional_parameters/origin_lib.dart:11:18: Error: The parameter 'i' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void method([int i]) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/required.dart.outline.expect b/pkg/front_end/testcases/nnbd/required.dart.outline.expect
index ff5e088..f5a1db6 100644
--- a/pkg/front_end/testcases/nnbd/required.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/required.dart.outline.expect
@@ -2,7 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: Optional parameter 'x' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: The parameter 'x' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo({x}) {}
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/required.dart.strong.expect b/pkg/front_end/testcases/nnbd/required.dart.strong.expect
index 55eb694..dfe4abf 100644
--- a/pkg/front_end/testcases/nnbd/required.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/required.dart.strong.expect
@@ -2,7 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: Optional parameter 'x' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: The parameter 'x' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo({x}) {}
// ^
//
@@ -21,7 +22,8 @@
// f2 = (int a = 42, [int b]) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g({int a, required int b = 42}) {}
// ^
//
@@ -29,7 +31,8 @@
// void g({int a, required int b = 42}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f = ({int a, required int b = 42}) {};
// ^
//
@@ -37,11 +40,13 @@
// f = ({int a, required int b = 42}) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g2(int a = 42, [int b]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f2 = (int a = 42, [int b]) {};
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/required.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/required.dart.strong.transformed.expect
index 55eb694..dfe4abf 100644
--- a/pkg/front_end/testcases/nnbd/required.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/required.dart.strong.transformed.expect
@@ -2,7 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: Optional parameter 'x' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: The parameter 'x' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo({x}) {}
// ^
//
@@ -21,7 +22,8 @@
// f2 = (int a = 42, [int b]) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g({int a, required int b = 42}) {}
// ^
//
@@ -29,7 +31,8 @@
// void g({int a, required int b = 42}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f = ({int a, required int b = 42}) {};
// ^
//
@@ -37,11 +40,13 @@
// f = ({int a, required int b = 42}) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g2(int a = 42, [int b]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f2 = (int a = 42, [int b]) {};
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/required.dart.weak.expect b/pkg/front_end/testcases/nnbd/required.dart.weak.expect
index 55eb694..dfe4abf 100644
--- a/pkg/front_end/testcases/nnbd/required.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/required.dart.weak.expect
@@ -2,7 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: Optional parameter 'x' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: The parameter 'x' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo({x}) {}
// ^
//
@@ -21,7 +22,8 @@
// f2 = (int a = 42, [int b]) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g({int a, required int b = 42}) {}
// ^
//
@@ -29,7 +31,8 @@
// void g({int a, required int b = 42}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f = ({int a, required int b = 42}) {};
// ^
//
@@ -37,11 +40,13 @@
// f = ({int a, required int b = 42}) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g2(int a = 42, [int b]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f2 = (int a = 42, [int b]) {};
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/required.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/required.dart.weak.transformed.expect
index 55eb694..dfe4abf 100644
--- a/pkg/front_end/testcases/nnbd/required.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/required.dart.weak.transformed.expect
@@ -2,7 +2,8 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: Optional parameter 'x' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:29:8: Error: The parameter 'x' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo({x}) {}
// ^
//
@@ -21,7 +22,8 @@
// f2 = (int a = 42, [int b]) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:48:15: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g({int a, required int b = 42}) {}
// ^
//
@@ -29,7 +31,8 @@
// void g({int a, required int b = 42}) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: Optional parameter 'a' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:49:13: Error: The parameter 'a' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f = ({int a, required int b = 42}) {};
// ^
//
@@ -37,11 +40,13 @@
// f = ({int a, required int b = 42}) {};
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:52:28: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// void g2(int a = 42, [int b]) {}
// ^
//
-// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: Optional parameter 'b' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required.dart:53:26: Error: The parameter 'b' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// f2 = (int a = 42, [int b]) {};
// ^
//
diff --git a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.outline.expect b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.outline.expect
index 8dab663..4e786d8 100644
--- a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.outline.expect
+++ b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.outline.expect
@@ -6,11 +6,13 @@
// foo({required int parameter = 42}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo2({int parameter}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo3([int parameter]) {}
// ^^^^^^^^^
//
diff --git a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.expect b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.expect
index 41566f3..0f14fea 100644
--- a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.expect
+++ b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.expect
@@ -6,11 +6,13 @@
// foo({required int parameter = 42}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo2({int parameter}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo3([int parameter]) {}
// ^^^^^^^^^
//
diff --git a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.transformed.expect
index 41566f3..0f14fea 100644
--- a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.strong.transformed.expect
@@ -6,11 +6,13 @@
// foo({required int parameter = 42}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo2({int parameter}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo3([int parameter]) {}
// ^^^^^^^^^
//
diff --git a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.expect b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.expect
index 41566f3..0f14fea 100644
--- a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.expect
+++ b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.expect
@@ -6,11 +6,13 @@
// foo({required int parameter = 42}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo2({int parameter}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo3([int parameter]) {}
// ^^^^^^^^^
//
diff --git a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.transformed.expect
index 41566f3..0f14fea 100644
--- a/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/nnbd/required_named_parameter.dart.weak.transformed.expect
@@ -6,11 +6,13 @@
// foo({required int parameter = 42}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:7:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo2({int parameter}) {}
// ^^^^^^^^^
//
-// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: Optional parameter 'parameter' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/nnbd/required_named_parameter.dart:8:11: Error: The parameter 'parameter' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// foo3([int parameter]) {}
// ^^^^^^^^^
//
diff --git a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.outline.expect b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.outline.expect
index 93422d0..f6aa033 100644
--- a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.outline.expect
+++ b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.outline.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: Optional parameter 'bar' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: The parameter 'bar' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: Optional parameter 'bar2' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: The parameter 'bar2' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^^
//
diff --git a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.expect b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.expect
index 1f7ce47..4449dd3 100644
--- a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.expect
+++ b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: Optional parameter 'bar' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: The parameter 'bar' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: Optional parameter 'bar2' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: The parameter 'bar2' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^^
//
diff --git a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.transformed.expect b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.transformed.expect
index db25a4a..57c58e3 100644
--- a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.strong.transformed.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: Optional parameter 'bar' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: The parameter 'bar' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: Optional parameter 'bar2' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: The parameter 'bar2' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^^
//
diff --git a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.expect b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.expect
index 1f7ce47..4449dd3 100644
--- a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.expect
+++ b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: Optional parameter 'bar' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: The parameter 'bar' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: Optional parameter 'bar2' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: The parameter 'bar2' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^^
//
diff --git a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.transformed.expect b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.transformed.expect
index db25a4a..57c58e3 100644
--- a/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/value_class/copy_with_call_sites.dart.weak.transformed.expect
@@ -2,11 +2,13 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: Optional parameter 'bar' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:21: Error: The parameter 'bar' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^
//
-// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: Optional parameter 'bar2' should have a default value because its type 'int' doesn't allow null.
+// pkg/front_end/testcases/value_class/copy_with_call_sites.dart:20:30: Error: The parameter 'bar2' can't have a value of 'null' because of its type 'int', but the implicit default value is 'null'.
+// Try adding either an explicit non-'null' default value or the 'required' modifier.
// Foo copyWith({int bar, int bar2}) {
// ^^^^
//
diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc
index ea6b457..ba75d00 100644
--- a/runtime/vm/compiler/frontend/scope_builder.cc
+++ b/runtime/vm/compiler/frontend/scope_builder.cc
@@ -1274,7 +1274,7 @@
// debuggable position in the initializer.
TokenPosition end_position = helper_.reader_.max_position();
if (end_position.IsReal()) {
- end_position.Next();
+ end_position = end_position.Next();
}
LocalVariable* variable =
MakeVariable(helper.position_, end_position, name, type);
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 5f3ca29..d1096d7 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -3033,7 +3033,7 @@
while ((loc == NULL) && (first_token_idx <= last_token_idx)) {
loc = SetBreakpoint(script, first_token_idx, last_token_idx, line_number,
column_number, Function::Handle());
- first_token_idx.Next();
+ first_token_idx = first_token_idx.Next();
}
if ((loc == NULL) && FLAG_verbose_debug) {
OS::PrintErr("No executable code at line %" Pd " in '%s'\n", line_number,
diff --git a/runtime/vm/token_position.cc b/runtime/vm/token_position.cc
index b94ddff..0f8ae68 100644
--- a/runtime/vm/token_position.cc
+++ b/runtime/vm/token_position.cc
@@ -27,12 +27,12 @@
}
#define DEFINE_VALUES(name, value) \
- const TokenPosition TokenPosition::k##name = TokenPosition(value);
+ const TokenPosition TokenPosition::k##name(value);
SENTINEL_TOKEN_DESCRIPTORS(DEFINE_VALUES);
#undef DEFINE_VALUES
-const TokenPosition TokenPosition::kMinSource = TokenPosition(kMinSourcePos);
+const TokenPosition TokenPosition::kMinSource(kMinSourcePos);
-const TokenPosition TokenPosition::kMaxSource = TokenPosition(kMaxSourcePos);
+const TokenPosition TokenPosition::kMaxSource(kMaxSourcePos);
const char* TokenPosition::ToCString() const {
switch (value_) {
diff --git a/runtime/vm/token_position.h b/runtime/vm/token_position.h
index c28f9a4..270a14c 100644
--- a/runtime/vm/token_position.h
+++ b/runtime/vm/token_position.h
@@ -95,11 +95,10 @@
// Encode for writing into a snapshot.
int32_t SnapshotEncode();
- // Increment the token position.
+ // Given a real token position, returns the next real token position.
TokenPosition Next() {
ASSERT(IsReal());
- value_++;
- return *this;
+ return TokenPosition(value_ + 1);
}
// The raw value.
diff --git a/sdk/lib/_internal/vm/bin/socket_patch.dart b/sdk/lib/_internal/vm/bin/socket_patch.dart
index d567603..f2a91d8 100644
--- a/sdk/lib/_internal/vm/bin/socket_patch.dart
+++ b/sdk/lib/_internal/vm/bin/socket_patch.dart
@@ -574,16 +574,28 @@
static Future<ConnectionTask<_NativeSocket>> startConnect(
dynamic host, int port, dynamic sourceAddress) {
+ // Looks up [sourceAddress] to one or more IP addresses,
+ // then tries connecting to each one until a connection succeeds.
+ // Attempts are staggered by a minimum delay, so a new
+ // attempt isn't made until either a previous attempt has *failed*,
+ // or the delay has passed.
+ // This ensures that at most *n* uncompleted connections can be
+ // active after *n* × *delay* time has passed.
if (host is String) {
host = escapeLinkLocalAddress(host);
}
_throwOnBadPort(port);
- if (sourceAddress != null && sourceAddress is! _InternetAddress) {
- if (sourceAddress is String) {
- sourceAddress = new InternetAddress(sourceAddress);
- }
+ _InternetAddress? source;
+ if (sourceAddress is _InternetAddress) {
+ source = sourceAddress;
+ } else if (sourceAddress is String) {
+ source = new _InternetAddress.fromString(sourceAddress);
}
- return new Future.value(host).then((host) {
+ // Should we throw if sourceAddress is not one of:
+ // null, _InternetAddress or String?
+ // Is it somehow ensured upstream
+ // that only those three types will reach here?
+ return new Future.value(host).then<List<InternetAddress>>((host) {
if (host is _InternetAddress) return [host];
return lookup(host).then((addresses) {
if (addresses.isEmpty) {
@@ -592,23 +604,43 @@
return addresses;
});
}).then((addresses) {
+ assert(addresses.isNotEmpty);
+ // Completer for result.
var completer = new Completer<_NativeSocket>();
- var it = (addresses as List<InternetAddress>).iterator;
+ // Index of next address in [addresses] to try.
+ var index = 0;
+ // Error, set if an error occurs.
+ // Keeps first error if multiple errors occour.
var error = null;
- var connecting = new HashMap();
+ // Active timers for on-going connection attempts.
+ // Contains all sockets which haven't received and initial
+ // write or error event.
+ var connecting = <_NativeSocket>{};
+ // Timer counting down from the last connection attempt.
+ // Reset when a new connection is attempted,
+ // which happens either when a previous timer runs out,
+ // or when a previous connection attempt fails.
+ Timer? timer;
+ // Attempt to connect to the next address in [addresses].
+ //
+ // Called initially, then when either a connection attempt fails,
+ // or an amount of time has passed since the last connection
+ // was attempted.
void connectNext() {
- if (!it.moveNext()) {
+ timer?.cancel();
+ if (index >= addresses.length) {
if (connecting.isEmpty) {
assert(error != null);
+ assert(!completer.isCompleted);
completer.completeError(error);
}
return;
}
- final _InternetAddress address = it.current as _InternetAddress;
+ final address = addresses[index++] as _InternetAddress;
var socket = new _NativeSocket.normal(address);
var result;
- if (sourceAddress == null) {
+ if (source == null) {
if (address.type == InternetAddressType.unix) {
result = socket.nativeCreateUnixDomainConnect(
address.address, _Namespace._namespace);
@@ -617,97 +649,103 @@
address._in_addr, port, address._scope_id);
}
} else {
- assert(sourceAddress is _InternetAddress);
if (address.type == InternetAddressType.unix) {
- assert(sourceAddress.type == InternetAddressType.unix);
+ assert(source.type == InternetAddressType.unix);
result = socket.nativeCreateUnixDomainBindConnect(
- address.address, sourceAddress.address, _Namespace._namespace);
+ address.address, source.address, _Namespace._namespace);
} else {
- result = socket.nativeCreateBindConnect(address._in_addr, port,
- sourceAddress._in_addr, address._scope_id);
+ result = socket.nativeCreateBindConnect(
+ address._in_addr, port, source._in_addr, address._scope_id);
}
}
if (result is OSError) {
// Keep first error, if present.
if (error == null) {
int errorCode = result.errorCode;
- if (sourceAddress != null &&
+ if (source != null &&
errorCode != null &&
socket.isBindError(errorCode)) {
- error = createError(result, "Bind failed", sourceAddress);
+ error = createError(result, "Bind failed", source);
} else {
error = createError(result, "Connection failed", address, port);
}
}
- connectNext();
- } else {
- // Query the local port for error messages.
- try {
- socket.port;
- } catch (e) {
- if (error == null) {
- error = createError(e, "Connection failed", address, port);
- }
- connectNext();
- }
- // Set up timer for when we should retry the next address
- // (if any).
- var duration =
- address.isLoopback ? _retryDurationLoopback : _retryDuration;
- var timer = new Timer(duration, connectNext);
-
- connecting[socket] = timer;
- // Setup handlers for receiving the first write event which
- // indicate that the socket is fully connected.
- socket.setHandlers(write: () {
- timer.cancel();
- connecting.remove(socket);
- // From 'man 2 connect':
- // After select(2) indicates writability, use getsockopt(2) to read
- // the SO_ERROR option at level SOL_SOCKET to determine whether
- // connect() completed successfully (SO_ERROR is zero) or
- // unsuccessfully.
- OSError osError = socket.nativeGetError();
- if (osError.errorCode != 0) {
- socket.close();
- if (error == null) error = osError;
- if (connecting.isEmpty) connectNext();
- return;
- }
- socket.setListening(read: false, write: false);
- completer.complete(socket);
- connecting.forEach((s, t) {
- t.cancel();
- s.close();
- s.setHandlers();
- s.setListening(read: false, write: false);
- });
- connecting.clear();
- }, error: (e, st) {
- timer.cancel();
- socket.close();
- // Keep first error, if present.
- if (error == null) error = e;
- connecting.remove(socket);
- if (connecting.isEmpty) connectNext();
- });
- socket.setListening(read: false, write: true);
+ connectNext(); // Try again after failure to connect.
+ return;
}
+ // Query the local port for error messages.
+ try {
+ socket.port;
+ } catch (e) {
+ if (error == null) {
+ error = createError(e, "Connection failed", address, port);
+ }
+ connectNext(); // Try again after failure to connect.
+ return;
+ }
+
+ // Try again if no response (failure or success) within a duration.
+ // If this occurs, the socket is still trying to connect, and might
+ // succeed or fail later.
+ var duration =
+ address.isLoopback ? _retryDurationLoopback : _retryDuration;
+ timer = new Timer(duration, connectNext);
+
+ connecting.add(socket);
+ // Setup handlers for receiving the first write event which
+ // indicate that the socket is fully connected.
+ socket.setHandlers(write: () {
+ // First remote response on connection.
+ // If error, drop the socket and go to the next address.
+ // If success, complete with the socket
+ // and stop all other open connection attempts.
+ connecting.remove(socket);
+ // From 'man 2 connect':
+ // After select(2) indicates writability, use getsockopt(2) to read
+ // the SO_ERROR option at level SOL_SOCKET to determine whether
+ // connect() completed successfully (SO_ERROR is zero) or
+ // unsuccessfully.
+ OSError osError = socket.nativeGetError();
+ if (osError.errorCode != 0) {
+ socket.close();
+ error ??= osError;
+ connectNext(); // Try again after failure to connect.
+ return;
+ }
+ // Connection success!
+ // Stop all other connecting sockets and timers.
+ timer!.cancel();
+ socket.setListening(read: false, write: false);
+ for (var s in connecting) {
+ s.close();
+ s.setHandlers();
+ s.setListening(read: false, write: false);
+ }
+ connecting.clear();
+ completer.complete(socket);
+ }, error: (e, st) {
+ connecting.remove(socket);
+ socket.close();
+ socket.setHandlers();
+ socket.setListening(read: false, write: false);
+ // Keep first error, if present.
+ error ??= e;
+ connectNext(); // Try again after failure to connect.
+ });
+ socket.setListening(read: false, write: true);
}
void onCancel() {
- connecting.forEach((s, t) {
- t.cancel();
+ timer?.cancel();
+ for (var s in connecting) {
s.close();
s.setHandlers();
s.setListening(read: false, write: false);
- if (error == null) {
- error = createError(null,
- "Connection attempt cancelled, host: ${host}, port: ${port}");
- }
- });
+ }
connecting.clear();
if (!completer.isCompleted) {
+ error ??= createError(null,
+ "Connection attempt cancelled, host: ${host}, port: ${port}");
completer.completeError(error);
}
}
diff --git a/tools/VERSION b/tools/VERSION
index c3af410..ac2b734 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 12
PATCH 0
-PRERELEASE 111
+PRERELEASE 112
PRERELEASE_PATCH 0
\ No newline at end of file