Skip to content

Commit

Permalink
analyzer: Correct quoting of 'null' in messages
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
srawlins authored and Commit Queue committed Aug 19, 2024
1 parent 9a2dfac commit 44dd260
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions pkg/analyzer/lib/src/error/codes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3818,8 +3818,8 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
"Constant values from a deferred library can't be used as a default "
"parameter value.",
correctionMessage:
"Try leaving the default as null and initializing the parameter inside "
"the function body.",
"Try leaving the default as 'null' and initializing the parameter "
"inside the function body.",
hasPublishedDocs: true,
);

Expand Down Expand Up @@ -4230,7 +4230,7 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
static const CompileTimeErrorCode NOT_NULL_AWARE_NULL_SPREAD =
CompileTimeErrorCode(
'NOT_NULL_AWARE_NULL_SPREAD',
"The Null typed expression can't be used with a non-null-aware spread.",
"The Null-typed expression can't be used with a non-null-aware spread.",
);

/// No parameters.
Expand Down Expand Up @@ -6109,8 +6109,8 @@ class StaticWarningCode extends AnalyzerErrorCode {
static const StaticWarningCode
INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT = StaticWarningCode(
'INVALID_NULL_AWARE_OPERATOR',
"The receiver can't be null because of short-circuiting, so the null-aware "
"operator '{0}' can't be used.",
"The receiver can't be 'null' because of short-circuiting, so the "
"null-aware operator '{0}' can't be used.",
correctionMessage: "Try replacing the operator '{0}' with '{1}'.",
hasPublishedDocs: true,
uniqueName: 'INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT',
Expand Down Expand Up @@ -7120,8 +7120,8 @@ class WarningCode extends AnalyzerErrorCode {
/// 1: the type argument associated with the method
static const WarningCode NULL_ARGUMENT_TO_NON_NULL_TYPE = WarningCode(
'NULL_ARGUMENT_TO_NON_NULL_TYPE',
"'{0}' shouldn't be called with a null argument for the non-nullable type "
"argument '{1}'.",
"'{0}' shouldn't be called with a 'null' argument for the non-nullable "
"type argument '{1}'.",
correctionMessage: "Try adding a non-null argument.",
hasPublishedDocs: true,
);
Expand Down Expand Up @@ -7490,7 +7490,7 @@ class WarningCode extends AnalyzerErrorCode {
static const WarningCode UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE =
WarningCode(
'UNNECESSARY_NULL_COMPARISON',
"The operand must be null, so the condition is always 'false'.",
"The operand must be 'null', so the condition is always 'false'.",
correctionMessage: "Remove the condition.",
hasPublishedDocs: true,
uniqueName: 'UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE',
Expand All @@ -7500,7 +7500,7 @@ class WarningCode extends AnalyzerErrorCode {
static const WarningCode UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE =
WarningCode(
'UNNECESSARY_NULL_COMPARISON',
"The operand must be null, so the condition is always 'true'.",
"The operand must be 'null', so the condition is always 'true'.",
correctionMessage: "Remove the condition.",
hasPublishedDocs: true,
uniqueName: 'UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE',
Expand All @@ -7510,7 +7510,7 @@ class WarningCode extends AnalyzerErrorCode {
static const WarningCode UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE =
WarningCode(
'UNNECESSARY_NULL_COMPARISON',
"The operand can't be null, so the condition is always 'false'.",
"The operand can't be 'null', so the condition is always 'false'.",
correctionMessage:
"Try removing the condition, an enclosing condition, or the whole "
"conditional statement.",
Expand All @@ -7522,7 +7522,7 @@ class WarningCode extends AnalyzerErrorCode {
static const WarningCode UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE =
WarningCode(
'UNNECESSARY_NULL_COMPARISON',
"The operand can't be null, so the condition is always 'true'.",
"The operand can't be 'null', so the condition is always 'true'.",
correctionMessage: "Remove the condition.",
hasPublishedDocs: true,
uniqueName: 'UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE',
Expand Down
16 changes: 8 additions & 8 deletions pkg/analyzer/messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11447,7 +11447,7 @@ CompileTimeErrorCode:
```
NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY:
problemMessage: "Constant values from a deferred library can't be used as a default parameter value."
correctionMessage: Try leaving the default as null and initializing the parameter inside the function body.
correctionMessage: Try leaving the default as 'null' and initializing the parameter inside the function body.
hasPublishedDocs: true
comment: No parameters.
documentation: |-
Expand Down Expand Up @@ -12733,7 +12733,7 @@ CompileTimeErrorCode:
var m = <int, String>{...l.asMap()};
```
NOT_NULL_AWARE_NULL_SPREAD:
problemMessage: "The Null typed expression can't be used with a non-null-aware spread."
problemMessage: "The Null-typed expression can't be used with a non-null-aware spread."
hasPublishedDocs: false
comment: No parameters.
NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS:
Expand Down Expand Up @@ -22695,7 +22695,7 @@ StaticWarningCode:
not be appropriate in some cases.)
INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT:
sharedName: INVALID_NULL_AWARE_OPERATOR
problemMessage: "The receiver can't be null because of short-circuiting, so the null-aware operator '{0}' can't be used."
problemMessage: "The receiver can't be 'null' because of short-circuiting, so the null-aware operator '{0}' can't be used."
correctionMessage: "Try replacing the operator '{0}' with '{1}'."
hasPublishedDocs: true
comment: |-
Expand Down Expand Up @@ -25498,7 +25498,7 @@ WarningCode:
}
```
NULL_ARGUMENT_TO_NON_NULL_TYPE:
problemMessage: "'{0}' shouldn't be called with a null argument for the non-nullable type argument '{1}'."
problemMessage: "'{0}' shouldn't be called with a 'null' argument for the non-nullable type argument '{1}'."
correctionMessage: Try adding a non-null argument.
hasPublishedDocs: true
comment: |-
Expand Down Expand Up @@ -26984,19 +26984,19 @@ WarningCode:
```
UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE:
sharedName: UNNECESSARY_NULL_COMPARISON
problemMessage: "The operand must be null, so the condition is always 'false'."
problemMessage: "The operand must be 'null', so the condition is always 'false'."
correctionMessage: Remove the condition.
hasPublishedDocs: true
comment: No parameters.
UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE:
sharedName: UNNECESSARY_NULL_COMPARISON
problemMessage: "The operand must be null, so the condition is always 'true'."
problemMessage: "The operand must be 'null', so the condition is always 'true'."
correctionMessage: Remove the condition.
hasPublishedDocs: true
comment: No parameters.
UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE:
sharedName: UNNECESSARY_NULL_COMPARISON
problemMessage: "The operand can't be null, so the condition is always 'false'."
problemMessage: "The operand can't be 'null', so the condition is always 'false'."
correctionMessage: Try removing the condition, an enclosing condition, or the whole conditional statement.
hasPublishedDocs: true
comment: No parameters.
Expand Down Expand Up @@ -27054,7 +27054,7 @@ WarningCode:
```
UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE:
sharedName: UNNECESSARY_NULL_COMPARISON
problemMessage: "The operand can't be null, so the condition is always 'true'."
problemMessage: "The operand can't be 'null', so the condition is always 'true'."
correctionMessage: Remove the condition.
hasPublishedDocs: true
comment: No parameters.
Expand Down
12 changes: 6 additions & 6 deletions pkg/analyzer/tool/diagnostics/diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10709,7 +10709,7 @@ abstract class C {

### invalid_null_aware_operator

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

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

### null_argument_to_non_null_type

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

#### Description
Expand Down Expand Up @@ -22799,13 +22799,13 @@ void f(int x) {

### unnecessary_null_comparison

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

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

_The operand must be null, so the condition is always 'false'._
_The operand must be 'null', so the condition is always 'false'._

_The operand must be null, so the condition is always 'true'._
_The operand must be 'null', so the condition is always 'true'._

#### Description

Expand Down

0 comments on commit 44dd260

Please sign in to comment.