Skip to content

Commit 9f2a622

Browse files
mit-mitCommit Queue
authored and
Commit Queue
committed
[3.0 alpha] Update CFE messages for Dart 3 sound null safety by-default
Fixes #50638 Change-Id: I511c5337099ae9576377ac8a82ef1bb78f6d34b1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273844 Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Michael Thomsen <[email protected]>
1 parent 3166622 commit 9f2a622

File tree

73 files changed

+162
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+162
-179
lines changed

pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9382,7 +9382,7 @@ const Template<Message Function(String string2)>
93829382
templateNullSafetyDisabledInvalidLanguageVersion =
93839383
const Template<Message Function(String string2)>(
93849384
problemMessageTemplate:
9385-
r"""This requires the null safety language feature, which requires language version of #string2 or higher.""",
9385+
r"""This requires null safety, which requires language version of #string2 or higher.""",
93869386
withArguments: _withArgumentsNullSafetyDisabledInvalidLanguageVersion);
93879387

93889388
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -9397,7 +9397,7 @@ Message _withArgumentsNullSafetyDisabledInvalidLanguageVersion(String string2) {
93979397
if (string2.isEmpty) throw 'No string provided';
93989398
return new Message(codeNullSafetyDisabledInvalidLanguageVersion,
93999399
problemMessage:
9400-
"""This requires the null safety language feature, which requires language version of ${string2} or higher.""",
9400+
"""This requires null safety, which requires language version of ${string2} or higher.""",
94019401
arguments: {'string2': string2});
94029402
}
94039403

@@ -9417,8 +9417,7 @@ const Template<
94179417
String
94189418
string)> templateNullSafetyOptOutExplicit = const Template<
94199419
Message Function(String string)>(
9420-
problemMessageTemplate:
9421-
r"""Null safety features are disabled for this library.""",
9420+
problemMessageTemplate: r"""Null safety is disabled for this library.""",
94229421
correctionMessageTemplate:
94239422
r"""Try removing the `@dart=` annotation or setting the language version to #string or higher.""",
94249423
withArguments: _withArgumentsNullSafetyOptOutExplicit);
@@ -9433,7 +9432,7 @@ const Code<Message Function(String string)> codeNullSafetyOptOutExplicit =
94339432
Message _withArgumentsNullSafetyOptOutExplicit(String string) {
94349433
if (string.isEmpty) throw 'No string provided';
94359434
return new Message(codeNullSafetyOptOutExplicit,
9436-
problemMessage: """Null safety features are disabled for this library.""",
9435+
problemMessage: """Null safety is disabled for this library.""",
94379436
correctionMessage:
94389437
"""Try removing the `@dart=` annotation or setting the language version to ${string} or higher.""",
94399438
arguments: {'string': string});
@@ -9445,8 +9444,7 @@ const Template<
94459444
String
94469445
string)> templateNullSafetyOptOutImplicit = const Template<
94479446
Message Function(String string)>(
9448-
problemMessageTemplate:
9449-
r"""Null safety features are disabled for this library.""",
9447+
problemMessageTemplate: r"""Null safety is disabled for this library.""",
94509448
correctionMessageTemplate:
94519449
r"""Try removing the package language version or setting the language version to #string or higher.""",
94529450
withArguments: _withArgumentsNullSafetyOptOutImplicit);
@@ -9461,7 +9459,7 @@ const Code<Message Function(String string)> codeNullSafetyOptOutImplicit =
94619459
Message _withArgumentsNullSafetyOptOutImplicit(String string) {
94629460
if (string.isEmpty) throw 'No string provided';
94639461
return new Message(codeNullSafetyOptOutImplicit,
9464-
problemMessage: """Null safety features are disabled for this library.""",
9462+
problemMessage: """Null safety is disabled for this library.""",
94659463
correctionMessage:
94669464
"""Try removing the package language version or setting the language version to ${string} or higher.""",
94679465
arguments: {'string': string});
@@ -10997,23 +10995,19 @@ const Code<Null> codeStrongModeNNBDButOptOut = messageStrongModeNNBDButOptOut;
1099710995
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
1099810996
const MessageCode messageStrongModeNNBDButOptOut = const MessageCode(
1099910997
"StrongModeNNBDButOptOut",
11000-
problemMessage:
11001-
r"""A library can't opt out of null safety by default, when using sound null safety.""");
10998+
problemMessage: r"""Library doesn't support null safety.""");
1100210999

1100311000
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
11004-
const Template<
11005-
Message Function(
11006-
List<String>
11007-
_names)> templateStrongModeNNBDPackageOptOut = const Template<
11008-
Message Function(List<String> _names)>(
11009-
problemMessageTemplate:
11010-
r"""Cannot run with sound null safety, because the following dependencies
11011-
don't support null safety:
11001+
const Template<Message Function(List<String> _names)>
11002+
templateStrongModeNNBDPackageOptOut =
11003+
const Template<Message Function(List<String> _names)>(
11004+
problemMessageTemplate:
11005+
r"""The following dependencies don't support null safety:
1101211006

1101311007
#names
1101411008

1101511009
For solutions, see https://dart.dev/go/unsound-null-safety""",
11016-
withArguments: _withArgumentsStrongModeNNBDPackageOptOut);
11010+
withArguments: _withArgumentsStrongModeNNBDPackageOptOut);
1101711011

1101811012
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
1101911013
const Code<Message Function(List<String> _names)>
@@ -11027,9 +11021,7 @@ Message _withArgumentsStrongModeNNBDPackageOptOut(List<String> _names) {
1102711021
if (_names.isEmpty) throw 'No names provided';
1102811022
String names = itemizeNames(_names);
1102911023
return new Message(codeStrongModeNNBDPackageOptOut,
11030-
problemMessage:
11031-
"""Cannot run with sound null safety, because the following dependencies
11032-
don't support null safety:
11024+
problemMessage: """The following dependencies don't support null safety:
1103311025

1103411026
${names}
1103511027

pkg/front_end/messages.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ ExperimentDisabled:
306306
analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED
307307

308308
NullSafetyDisabledInvalidLanguageVersion:
309-
problemMessage: "This requires the null safety language feature, which requires language version of #string2 or higher."
309+
problemMessage: "This requires null safety, which requires language version of #string2 or higher."
310310
analyzerCode: ParserErrorCode.EXPERIMENT_NOT_ENABLED
311311

312312
ExperimentDisabledInvalidLanguageVersion:
@@ -1591,12 +1591,11 @@ Unspecified:
15911591
problemMessage: "#string"
15921592

15931593
StrongModeNNBDButOptOut:
1594-
problemMessage: "A library can't opt out of null safety by default, when using sound null safety."
1594+
problemMessage: "Library doesn't support null safety."
15951595

15961596
StrongModeNNBDPackageOptOut:
15971597
problemMessage: |
1598-
Cannot run with sound null safety, because the following dependencies
1599-
don't support null safety:
1598+
The following dependencies don't support null safety:
16001599
16011600
#names
16021601
@@ -5173,15 +5172,15 @@ FieldNonNullableNotInitializedByConstructorError:
51735172
problemMessage: "This constructor should initialize field '#name' because its type '#type' doesn't allow null."
51745173

51755174
NullSafetyOptOutExplicit:
5176-
problemMessage: "Null safety features are disabled for this library."
5175+
problemMessage: "Null safety is disabled for this library."
51775176
correctionMessage: "Try removing the `@dart=` annotation or setting the language version to #string or higher."
51785177

51795178
ExperimentOptOutExplicit:
51805179
problemMessage: "The '#string' language feature is disabled for this library."
51815180
correctionMessage: "Try removing the `@dart=` annotation or setting the language version to #string2 or higher."
51825181

51835182
NullSafetyOptOutImplicit:
5184-
problemMessage: "Null safety features are disabled for this library."
5183+
problemMessage: "Null safety is disabled for this library."
51855184
correctionMessage: "Try removing the package language version or setting the language version to #string or higher."
51865185

51875186
NullSafetyOptOutComment:

pkg/front_end/testcases/dart2js/mixin_from_opt_in/main.dart.strong.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Problems in component:
33
//
4-
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart: Error: A library can't opt out of null safety by default, when using sound null safety.
4+
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart: Error: Library doesn't support null safety.
55
//
66
library /*isNonNullableByDefault*/;
77
import self as self;
@@ -76,7 +76,7 @@ library;
7676
//
7777
// Problems in library:
7878
//
79-
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
79+
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: Library doesn't support null safety.
8080
// // @dart=2.9
8181
// ^^^^^^^^^^^^
8282
//

pkg/front_end/testcases/dart2js/mixin_from_opt_in/main.dart.strong.transformed.expect

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Problems in component:
33
//
4-
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart: Error: A library can't opt out of null safety by default, when using sound null safety.
4+
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart: Error: Library doesn't support null safety.
55
//
66
library /*isNonNullableByDefault*/;
77
import self as self;
@@ -76,7 +76,7 @@ library;
7676
//
7777
// Problems in library:
7878
//
79-
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
79+
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: Library doesn't support null safety.
8080
// // @dart=2.9
8181
// ^^^^^^^^^^^^
8282
//

pkg/front_end/testcases/dart2js/mixin_from_opt_in/main.no_link.dart.strong.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ library;
2727
//
2828
// Problems in library:
2929
//
30-
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
30+
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: Library doesn't support null safety.
3131
// // @dart=2.9
3232
// ^^^^^^^^^^^^
3333
//

pkg/front_end/testcases/dart2js/mixin_from_opt_in/main.no_link.dart.strong.transformed.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ library;
2727
//
2828
// Problems in library:
2929
//
30-
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
30+
// pkg/front_end/testcases/dart2js/mixin_from_opt_in/opt_out_lib.dart:5:1: Error: Library doesn't support null safety.
3131
// // @dart=2.9
3232
// ^^^^^^^^^^^^
3333
//

pkg/front_end/testcases/general/experiment_release_version/main.dart.weak.expect

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
//
22
// Problems outside component:
33
//
4-
// pkg/front_end/testcases/general/experiment_release_version/allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety features are disabled for this library.
4+
// pkg/front_end/testcases/general/experiment_release_version/allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety is disabled for this library.
55
// Try removing the `@dart=` annotation or setting the language version to 2.9 or higher.
66
// int? versioned_2_8_AllowedPackage; // error
77
// ^
88
// pkg/front_end/testcases/general/experiment_release_version/allowed_package/lib/versioned_2_8_lib.dart:5:1: Context: This is the annotation that opts out this library from null safety features.
99
// // @dart=2.8
1010
// ^^^^^^^^^^^^
1111
//
12-
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: Null safety features are disabled for this library.
12+
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: Null safety is disabled for this library.
1313
// Try removing the package language version or setting the language version to 2.10 or higher.
1414
// int? versionedUnallowedPackage; // error
1515
// ^
1616
//
17-
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety features are disabled for this library.
17+
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety is disabled for this library.
1818
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
1919
// int? versioned_2_8_AllowedPackage; // error
2020
// ^
2121
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:5:1: Context: This is the annotation that opts out this library from null safety features.
2222
// // @dart=2.8
2323
// ^^^^^^^^^^^^
2424
//
25-
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: Null safety features are disabled for this library.
25+
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: Null safety is disabled for this library.
2626
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
2727
// int? versioned_2_9_AllowedPackage; // error
2828
// ^
@@ -58,7 +58,7 @@ library;
5858
//
5959
// Problems in library:
6060
//
61-
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: Null safety features are disabled for this library.
61+
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: Null safety is disabled for this library.
6262
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
6363
// int? versioned_2_8_Library; // error
6464
// ^
@@ -75,7 +75,7 @@ library;
7575
//
7676
// Problems in library:
7777
//
78-
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: Null safety features are disabled for this library.
78+
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: Null safety is disabled for this library.
7979
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
8080
// int? versioned_2_9_Library; // error
8181
// ^
@@ -92,7 +92,7 @@ library;
9292
//
9393
// Problems in library:
9494
//
95-
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:8:4: Error: Null safety features are disabled for this library.
95+
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:8:4: Error: Null safety is disabled for this library.
9696
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
9797
// int? versioned_2_10_Library; // error
9898
// ^

pkg/front_end/testcases/general/experiment_release_version/main.dart.weak.modular.expect

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
//
22
// Problems outside component:
33
//
4-
// pkg/front_end/testcases/general/experiment_release_version/allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety features are disabled for this library.
4+
// pkg/front_end/testcases/general/experiment_release_version/allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety is disabled for this library.
55
// Try removing the `@dart=` annotation or setting the language version to 2.9 or higher.
66
// int? versioned_2_8_AllowedPackage; // error
77
// ^
88
// pkg/front_end/testcases/general/experiment_release_version/allowed_package/lib/versioned_2_8_lib.dart:5:1: Context: This is the annotation that opts out this library from null safety features.
99
// // @dart=2.8
1010
// ^^^^^^^^^^^^
1111
//
12-
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: Null safety features are disabled for this library.
12+
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/unversioned_lib.dart:5:4: Error: Null safety is disabled for this library.
1313
// Try removing the package language version or setting the language version to 2.10 or higher.
1414
// int? versionedUnallowedPackage; // error
1515
// ^
1616
//
17-
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety features are disabled for this library.
17+
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:7:4: Error: Null safety is disabled for this library.
1818
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
1919
// int? versioned_2_8_AllowedPackage; // error
2020
// ^
2121
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_8_lib.dart:5:1: Context: This is the annotation that opts out this library from null safety features.
2222
// // @dart=2.8
2323
// ^^^^^^^^^^^^
2424
//
25-
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: Null safety features are disabled for this library.
25+
// pkg/front_end/testcases/general/experiment_release_version/not_allowed_package/lib/versioned_2_9_lib.dart:7:4: Error: Null safety is disabled for this library.
2626
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
2727
// int? versioned_2_9_AllowedPackage; // error
2828
// ^
@@ -58,7 +58,7 @@ library;
5858
//
5959
// Problems in library:
6060
//
61-
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: Null safety features are disabled for this library.
61+
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_8_lib.dart:7:4: Error: Null safety is disabled for this library.
6262
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
6363
// int? versioned_2_8_Library; // error
6464
// ^
@@ -75,7 +75,7 @@ library;
7575
//
7676
// Problems in library:
7777
//
78-
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: Null safety features are disabled for this library.
78+
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_9_lib.dart:7:4: Error: Null safety is disabled for this library.
7979
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
8080
// int? versioned_2_9_Library; // error
8181
// ^
@@ -92,7 +92,7 @@ library;
9292
//
9393
// Problems in library:
9494
//
95-
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:8:4: Error: Null safety features are disabled for this library.
95+
// pkg/front_end/testcases/general/experiment_release_version/versioned_2_10_lib.dart:8:4: Error: Null safety is disabled for this library.
9696
// Try removing the `@dart=` annotation or setting the language version to 2.10 or higher.
9797
// int? versioned_2_10_Library; // error
9898
// ^

0 commit comments

Comments
 (0)