diff --git a/pkg/analyzer/lib/src/error/codes.g.dart b/pkg/analyzer/lib/src/error/codes.g.dart index 3e5d4fd64fea..9fe34ca2b2db 100644 --- a/pkg/analyzer/lib/src/error/codes.g.dart +++ b/pkg/analyzer/lib/src/error/codes.g.dart @@ -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, ); @@ -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. @@ -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', @@ -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, ); @@ -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', @@ -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', @@ -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.", @@ -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', diff --git a/pkg/analyzer/messages.yaml b/pkg/analyzer/messages.yaml index d5ae6d06dfb5..24460a80be0c 100644 --- a/pkg/analyzer/messages.yaml +++ b/pkg/analyzer/messages.yaml @@ -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: |- @@ -12733,7 +12733,7 @@ CompileTimeErrorCode: var m = {...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: @@ -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: |- @@ -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: |- @@ -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. @@ -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. diff --git a/pkg/analyzer/tool/diagnostics/diagnostics.md b/pkg/analyzer/tool/diagnostics/diagnostics.md index 063bdde626ef..3eb37202778c 100644 --- a/pkg/analyzer/tool/diagnostics/diagnostics.md +++ b/pkg/analyzer/tool/diagnostics/diagnostics.md @@ -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._ @@ -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 @@ -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