Skip to content

Commit 359c36a

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Improve some correction messages; use double quote more consistently
Change-Id: I9103785ddb763c90b0bcf9f1c0928313c736ea5e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108360 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Auto-Submit: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
1 parent c1d3bf8 commit 359c36a

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ class CompileTimeErrorCode extends ErrorCode {
914914
'DEFAULT_LIST_CONSTRUCTOR_MISMATCH',
915915
"A list whose values cannot be 'null' cannot be given an initial length "
916916
"because the initial values would all be 'null'.",
917-
correction: "Try removing the argument.");
917+
correction: "Try removing the argument or using 'List.filled'.");
918918

919919
/**
920920
* 6.2.1 Required Formals: By means of a function signature that names the
@@ -1591,11 +1591,11 @@ class CompileTimeErrorCode extends ErrorCode {
15911591
const CompileTimeErrorCode(
15921592
'INTEGER_LITERAL_IMPRECISE_AS_DOUBLE',
15931593
"The integer literal is being used as a double, but can't be "
1594-
'represented as a 64 bit double without overflow and/or loss of '
1595-
'precision: {0}',
1594+
"represented as a 64 bit double without overflow and/or loss of "
1595+
"precision: {0}",
15961596
correction:
1597-
'Try using the BigInt class, or switch to the closest valid '
1598-
'double: {1}');
1597+
"Try using the BigInt class, or switch to the closest valid "
1598+
"double: {1}");
15991599

16001600
/**
16011601
* 15 Metadata: Metadata consists of a series of annotations, each of which
@@ -1698,7 +1698,8 @@ class CompileTimeErrorCode extends ErrorCode {
16981698
"The parameter '{0}' cannot have a value of 'null' because of its "
16991699
"type, but no default value it valid, so it must be a required "
17001700
"parameter.",
1701-
correction: "Try making this nullable (by adding a '?') or "
1701+
correction: "Try making this nullable (by adding a '?'), "
1702+
"adding a default value, or "
17021703
"making this a required parameter.");
17031704

17041705
/**
@@ -2985,9 +2986,9 @@ class CompileTimeErrorCode extends ErrorCode {
29852986
*/
29862987
static const CompileTimeErrorCode GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND =
29872988
const CompileTimeErrorCode('GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND',
2988-
'Generic function types may not be used as type parameter bounds',
2989-
correction: 'Try making the free variable in the function type part'
2990-
' of the larger declaration signature');
2989+
"Generic function types may not be used as type parameter bounds",
2990+
correction: "Try making the free variable in the function type part"
2991+
" of the larger declaration signature");
29912992

29922993
static const CompileTimeErrorCode FOR_IN_WITH_CONST_VARIABLE =
29932994
const CompileTimeErrorCode('FOR_IN_WITH_CONST_VARIABLE',
@@ -4882,10 +4883,10 @@ class StaticWarningCode extends ErrorCode {
48824883
static const StaticWarningCode UNCHECKED_USE_OF_NULLABLE_VALUE =
48834884
const StaticWarningCode(
48844885
'UNCHECKED_USE_OF_NULLABLE_VALUE',
4885-
'The expression is nullable and must be null-checked before it can be'
4886-
' used.',
4886+
"The expression is nullable and must be null-checked before it can be"
4887+
" used.",
48874888
correction:
4888-
'Try casting or check the value is not null before using it.');
4889+
"Try casting or check the value is not null before using it.");
48894890

48904891
/**
48914892
* It is a static warning to assign void to any non-void type in dart.
@@ -4898,9 +4899,9 @@ class StaticWarningCode extends ErrorCode {
48984899
'USE_OF_VOID_RESULT',
48994900
"The expression here has a type of 'void', and therefore cannot be used.",
49004901
correction:
4901-
'Check if you are using the correct API; there may be a function or'
4902+
"Check if you are using the correct API; there may be a function or"
49024903
" call that returns void you didn't expect. Also check type parameters"
4903-
' and variables which, in rare cases, may be void as well.');
4904+
" and variables which, in rare cases, may be void as well.");
49044905

49054906
@override
49064907
final ErrorSeverity errorSeverity;

0 commit comments

Comments
 (0)