Skip to content

Commit 44dd260

Browse files
srawlinsCommit Queue
authored and
Commit Queue
committed
analyzer: Correct quoting of 'null' in messages
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try Change-Id: I5bcde103555688709ab2193fb457f0686f032d82 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381301 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 9a2dfac commit 44dd260

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

pkg/analyzer/lib/src/error/codes.g.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,8 +3818,8 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
38183818
"Constant values from a deferred library can't be used as a default "
38193819
"parameter value.",
38203820
correctionMessage:
3821-
"Try leaving the default as null and initializing the parameter inside "
3822-
"the function body.",
3821+
"Try leaving the default as 'null' and initializing the parameter "
3822+
"inside the function body.",
38233823
hasPublishedDocs: true,
38243824
);
38253825

@@ -4230,7 +4230,7 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
42304230
static const CompileTimeErrorCode NOT_NULL_AWARE_NULL_SPREAD =
42314231
CompileTimeErrorCode(
42324232
'NOT_NULL_AWARE_NULL_SPREAD',
4233-
"The Null typed expression can't be used with a non-null-aware spread.",
4233+
"The Null-typed expression can't be used with a non-null-aware spread.",
42344234
);
42354235

42364236
/// No parameters.
@@ -6109,8 +6109,8 @@ class StaticWarningCode extends AnalyzerErrorCode {
61096109
static const StaticWarningCode
61106110
INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT = StaticWarningCode(
61116111
'INVALID_NULL_AWARE_OPERATOR',
6112-
"The receiver can't be null because of short-circuiting, so the null-aware "
6113-
"operator '{0}' can't be used.",
6112+
"The receiver can't be 'null' because of short-circuiting, so the "
6113+
"null-aware operator '{0}' can't be used.",
61146114
correctionMessage: "Try replacing the operator '{0}' with '{1}'.",
61156115
hasPublishedDocs: true,
61166116
uniqueName: 'INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT',
@@ -7120,8 +7120,8 @@ class WarningCode extends AnalyzerErrorCode {
71207120
/// 1: the type argument associated with the method
71217121
static const WarningCode NULL_ARGUMENT_TO_NON_NULL_TYPE = WarningCode(
71227122
'NULL_ARGUMENT_TO_NON_NULL_TYPE',
7123-
"'{0}' shouldn't be called with a null argument for the non-nullable type "
7124-
"argument '{1}'.",
7123+
"'{0}' shouldn't be called with a 'null' argument for the non-nullable "
7124+
"type argument '{1}'.",
71257125
correctionMessage: "Try adding a non-null argument.",
71267126
hasPublishedDocs: true,
71277127
);
@@ -7490,7 +7490,7 @@ class WarningCode extends AnalyzerErrorCode {
74907490
static const WarningCode UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE =
74917491
WarningCode(
74927492
'UNNECESSARY_NULL_COMPARISON',
7493-
"The operand must be null, so the condition is always 'false'.",
7493+
"The operand must be 'null', so the condition is always 'false'.",
74947494
correctionMessage: "Remove the condition.",
74957495
hasPublishedDocs: true,
74967496
uniqueName: 'UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE',
@@ -7500,7 +7500,7 @@ class WarningCode extends AnalyzerErrorCode {
75007500
static const WarningCode UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE =
75017501
WarningCode(
75027502
'UNNECESSARY_NULL_COMPARISON',
7503-
"The operand must be null, so the condition is always 'true'.",
7503+
"The operand must be 'null', so the condition is always 'true'.",
75047504
correctionMessage: "Remove the condition.",
75057505
hasPublishedDocs: true,
75067506
uniqueName: 'UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE',
@@ -7510,7 +7510,7 @@ class WarningCode extends AnalyzerErrorCode {
75107510
static const WarningCode UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE =
75117511
WarningCode(
75127512
'UNNECESSARY_NULL_COMPARISON',
7513-
"The operand can't be null, so the condition is always 'false'.",
7513+
"The operand can't be 'null', so the condition is always 'false'.",
75147514
correctionMessage:
75157515
"Try removing the condition, an enclosing condition, or the whole "
75167516
"conditional statement.",
@@ -7522,7 +7522,7 @@ class WarningCode extends AnalyzerErrorCode {
75227522
static const WarningCode UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE =
75237523
WarningCode(
75247524
'UNNECESSARY_NULL_COMPARISON',
7525-
"The operand can't be null, so the condition is always 'true'.",
7525+
"The operand can't be 'null', so the condition is always 'true'.",
75267526
correctionMessage: "Remove the condition.",
75277527
hasPublishedDocs: true,
75287528
uniqueName: 'UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE',

pkg/analyzer/messages.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11447,7 +11447,7 @@ CompileTimeErrorCode:
1144711447
```
1144811448
NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY:
1144911449
problemMessage: "Constant values from a deferred library can't be used as a default parameter value."
11450-
correctionMessage: Try leaving the default as null and initializing the parameter inside the function body.
11450+
correctionMessage: Try leaving the default as 'null' and initializing the parameter inside the function body.
1145111451
hasPublishedDocs: true
1145211452
comment: No parameters.
1145311453
documentation: |-
@@ -12733,7 +12733,7 @@ CompileTimeErrorCode:
1273312733
var m = <int, String>{...l.asMap()};
1273412734
```
1273512735
NOT_NULL_AWARE_NULL_SPREAD:
12736-
problemMessage: "The Null typed expression can't be used with a non-null-aware spread."
12736+
problemMessage: "The Null-typed expression can't be used with a non-null-aware spread."
1273712737
hasPublishedDocs: false
1273812738
comment: No parameters.
1273912739
NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS:
@@ -22695,7 +22695,7 @@ StaticWarningCode:
2269522695
not be appropriate in some cases.)
2269622696
INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT:
2269722697
sharedName: INVALID_NULL_AWARE_OPERATOR
22698-
problemMessage: "The receiver can't be null because of short-circuiting, so the null-aware operator '{0}' can't be used."
22698+
problemMessage: "The receiver can't be 'null' because of short-circuiting, so the null-aware operator '{0}' can't be used."
2269922699
correctionMessage: "Try replacing the operator '{0}' with '{1}'."
2270022700
hasPublishedDocs: true
2270122701
comment: |-
@@ -25498,7 +25498,7 @@ WarningCode:
2549825498
}
2549925499
```
2550025500
NULL_ARGUMENT_TO_NON_NULL_TYPE:
25501-
problemMessage: "'{0}' shouldn't be called with a null argument for the non-nullable type argument '{1}'."
25501+
problemMessage: "'{0}' shouldn't be called with a 'null' argument for the non-nullable type argument '{1}'."
2550225502
correctionMessage: Try adding a non-null argument.
2550325503
hasPublishedDocs: true
2550425504
comment: |-
@@ -26984,19 +26984,19 @@ WarningCode:
2698426984
```
2698526985
UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE:
2698626986
sharedName: UNNECESSARY_NULL_COMPARISON
26987-
problemMessage: "The operand must be null, so the condition is always 'false'."
26987+
problemMessage: "The operand must be 'null', so the condition is always 'false'."
2698826988
correctionMessage: Remove the condition.
2698926989
hasPublishedDocs: true
2699026990
comment: No parameters.
2699126991
UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE:
2699226992
sharedName: UNNECESSARY_NULL_COMPARISON
26993-
problemMessage: "The operand must be null, so the condition is always 'true'."
26993+
problemMessage: "The operand must be 'null', so the condition is always 'true'."
2699426994
correctionMessage: Remove the condition.
2699526995
hasPublishedDocs: true
2699626996
comment: No parameters.
2699726997
UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE:
2699826998
sharedName: UNNECESSARY_NULL_COMPARISON
26999-
problemMessage: "The operand can't be null, so the condition is always 'false'."
26999+
problemMessage: "The operand can't be 'null', so the condition is always 'false'."
2700027000
correctionMessage: Try removing the condition, an enclosing condition, or the whole conditional statement.
2700127001
hasPublishedDocs: true
2700227002
comment: No parameters.
@@ -27054,7 +27054,7 @@ WarningCode:
2705427054
```
2705527055
UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE:
2705627056
sharedName: UNNECESSARY_NULL_COMPARISON
27057-
problemMessage: "The operand can't be null, so the condition is always 'true'."
27057+
problemMessage: "The operand can't be 'null', so the condition is always 'true'."
2705827058
correctionMessage: Remove the condition.
2705927059
hasPublishedDocs: true
2706027060
comment: No parameters.

pkg/analyzer/tool/diagnostics/diagnostics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10709,7 +10709,7 @@ abstract class C {
1070910709

1071010710
### invalid_null_aware_operator
1071110711

10712-
_The receiver can't be null because of short-circuiting, so the null-aware
10712+
_The receiver can't be 'null' because of short-circuiting, so the null-aware
1071310713
operator '{0}' can't be used._
1071410714

1071510715
_The receiver can't be null, so the null-aware operator '{0}' is unnecessary._
@@ -16689,7 +16689,7 @@ class C with M {}
1668916689

1669016690
### null_argument_to_non_null_type
1669116691

16692-
_'{0}' shouldn't be called with a null argument for the non-nullable type
16692+
_'{0}' shouldn't be called with a 'null' argument for the non-nullable type
1669316693
argument '{1}'._
1669416694

1669516695
#### Description
@@ -22799,13 +22799,13 @@ void f(int x) {
2279922799

2280022800
### unnecessary_null_comparison
2280122801

22802-
_The operand can't be null, so the condition is always 'false'._
22802+
_The operand can't be 'null', so the condition is always 'false'._
2280322803

22804-
_The operand can't be null, so the condition is always 'true'._
22804+
_The operand can't be 'null', so the condition is always 'true'._
2280522805

22806-
_The operand must be null, so the condition is always 'false'._
22806+
_The operand must be 'null', so the condition is always 'false'._
2280722807

22808-
_The operand must be null, so the condition is always 'true'._
22808+
_The operand must be 'null', so the condition is always 'true'._
2280922809

2281022810
#### Description
2281122811

0 commit comments

Comments
 (0)