Skip to content

Commit 6143fb5

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Improve some diagnostic messages
Change-Id: Ic351c2addff76dea8fe49c7e2ce68b46043f0814 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177480 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 95c680e commit 6143fb5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9204,7 +9204,7 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
92049204
static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR =
92059205
CompileTimeErrorCode(
92069206
'RETURN_OF_INVALID_TYPE',
9207-
"A value of type '{0}' can't be returned from constructor '{2}' "
9207+
"A value of type '{0}' can't be returned from the constructor '{2}' "
92089208
"because it has a return type of '{1}'.",
92099209
hasPublishedDocs: true,
92109210
uniqueName: 'RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR',
@@ -9247,7 +9247,7 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
92479247
static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_FUNCTION =
92489248
CompileTimeErrorCode(
92499249
'RETURN_OF_INVALID_TYPE',
9250-
"A value of type '{0}' can't be returned from function '{2}' because "
9250+
"A value of type '{0}' can't be returned from the function '{2}' because "
92519251
"it has a return type of '{1}'.",
92529252
hasPublishedDocs: true,
92539253
uniqueName: 'RETURN_OF_INVALID_TYPE_FROM_FUNCTION',
@@ -9262,7 +9262,7 @@ class CompileTimeErrorCode extends AnalyzerErrorCode {
92629262
static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_METHOD =
92639263
CompileTimeErrorCode(
92649264
'RETURN_OF_INVALID_TYPE',
9265-
"A value of type '{0}' can't be returned from method '{2}' because "
9265+
"A value of type '{0}' can't be returned from the method '{2}' because "
92669266
"it has a return type of '{1}'.",
92679267
hasPublishedDocs: true,
92689268
uniqueName: 'RETURN_OF_INVALID_TYPE_FROM_METHOD',

pkg/analyzer/tool/diagnostics/diagnostics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7475,13 +7475,13 @@ class C {
74757475

74767476
### return_of_invalid_type
74777477

7478-
_A value of type '{0}' can't be returned from constructor '{2}' because it has a
7479-
return type of '{1}'._
7478+
_A value of type '{0}' can't be returned from the constructor '{2}' because it
7479+
has a return type of '{1}'._
74807480

7481-
_A value of type '{0}' can't be returned from function '{2}' because it has a
7482-
return type of '{1}'._
7481+
_A value of type '{0}' can't be returned from the function '{2}' because it has
7482+
a return type of '{1}'._
74837483

7484-
_A value of type '{0}' can't be returned from method '{2}' because it has a
7484+
_A value of type '{0}' can't be returned from the method '{2}' because it has a
74857485
return type of '{1}'._
74867486

74877487
#### Description

pkg/nnbd_migration/test/migration_cli_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,8 +2078,8 @@ environment:
20782078
expect(errorOutput, contains('1 analysis issue found:'));
20792079
expect(
20802080
errorOutput,
2081-
contains("A value of type 'Null' can't be returned from function 'f' "
2082-
"because it has a return type of 'int'"));
2081+
contains("A value of type 'Null' can't be returned from the function "
2082+
"'f' because it has a return type of 'int'"));
20832083
expect(errorOutput, contains('Set the lower SDK constraint'));
20842084
}
20852085

0 commit comments

Comments
 (0)