Skip to content

Commit 2bca2bf

Browse files
bwilkersonCommit Queue
authored andcommitted
Address review comments on documentation
This also adds quotes around a file name in an unrelated diagnostic. I accidentally noticed the missing quotes, but decided to fix them anyway. Change-Id: I99aae1ad6f4ea69129c5e41b3bdfff919ea54f9b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449840 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent bad3760 commit 2bca2bf

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11246,8 +11246,8 @@ class WarningCode extends DiagnosticCodeWithExpectedTypes {
1124611246
/// https://github.com/dart-lang/language/blob/master/resources/type-system/strict-inference.md
1124711247
///
1124811248
/// Parameters:
11249-
/// String p0: the name of the function or method whose return type couldn't
11250-
/// be inferred
11249+
/// String p0: the name of the function or method whose return type can't be
11250+
/// inferred
1125111251
static const WarningTemplate<
1125211252
LocatableDiagnostic Function({required String p0})
1125311253
>
@@ -12327,7 +12327,7 @@ class WarningCode extends DiagnosticCodeWithExpectedTypes {
1232712327
"Tearing off a constructor requires the 'constructor-tearoffs' language "
1232812328
"feature.",
1232912329
correctionMessage:
12330-
"Try updating your pubspec.yaml to set the minimum SDK constraint to "
12330+
"Try updating your 'pubspec.yaml' to set the minimum SDK constraint to "
1233112331
"2.15 or higher, and running 'pub get'.",
1233212332
hasPublishedDocs: true,
1233312333
expectedTypes: [],

pkg/analyzer/messages.yaml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24740,9 +24740,9 @@ WarningCode:
2474024740
documentation: |-
2474124741
#### Description
2474224742

24743-
The analyzer produces this diagnostic when
24744-
- the language option `strict-inference` has been enabled in the analysis options file,
24745-
- a list, map or set literal doesn't have type arguments, and
24743+
The analyzer produces this diagnostic when:
24744+
- the language option `strict-inference` is enabled in the analysis options file,
24745+
- a list, map, or set literal has no type arguments, and
2474624746
- the values for the type arguments can't be inferred from the elements.
2474724747

2474824748
#### Example
@@ -24756,8 +24756,8 @@ WarningCode:
2475624756
strict-inference: true
2475724757
```
2475824758

24759-
The following code produces this diagnostic because the type of the
24760-
elements of the list literal can't be inferred by the analyzer:
24759+
The following code produces this diagnostic because the type of the list
24760+
literal's elements can't be inferred:
2476124761

2476224762
```dart
2476324763
void f() {
@@ -24788,9 +24788,9 @@ WarningCode:
2478824788
documentation: |-
2478924789
#### Description
2479024790

24791-
The analyzer produces this diagnostic when
24792-
- the language option `strict-inference` has been enabled in the analysis options file,
24793-
- the invocation of a method or function doesn't have type arguments, and
24791+
The analyzer produces this diagnostic when:
24792+
- the language option `strict-inference` is enabled in the analysis options file,
24793+
- the invocation of a method or function has no type arguments, and
2479424794
- the values for the type arguments can't be inferred.
2479524795

2479624796
#### Example
@@ -24804,9 +24804,8 @@ WarningCode:
2480424804
strict-inference: true
2480524805
```
2480624806

24807-
The following code produces this diagnostic because the invocation of the
24808-
method `m` doesn't have type arguments and the type arguments can't be
24809-
inferred:
24807+
The following code produces this diagnostic because the invocation of `m`
24808+
has no explicit type arguments, and the arguments can't be inferred:
2481024809

2481124810
```dart
2481224811
abstract class C {
@@ -24833,7 +24832,8 @@ WarningCode:
2483324832
```
2483424833
INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE:
2483524834
parameters:
24836-
String p0: the name of the function or method whose return type couldn't be inferred
24835+
String p0: the name of the function or method whose return type can't be
24836+
inferred
2483724837
problemMessage: "The return type of '#p0' can't be inferred."
2483824838
correctionMessage: "Declare the return type of '#p0'."
2483924839
hasPublishedDocs: false
@@ -24846,9 +24846,9 @@ WarningCode:
2484624846
documentation: |-
2484724847
#### Description
2484824848

24849-
The analyzer produces this diagnostic when
24850-
- the language option `strict-inference` has been enabled in the analysis options file,
24851-
- the declaration of a method or function doesn't have a return type, and
24849+
The analyzer produces this diagnostic when:
24850+
- the language option `strict-inference` is enabled in the analysis options file,
24851+
- the declaration of a method or function has no return type, and
2485224852
- the return type can't be inferred.
2485324853

2485424854
#### Example
@@ -24911,9 +24911,9 @@ WarningCode:
2491124911
documentation: |-
2491224912
#### Description
2491324913

24914-
The analyzer produces this diagnostic when
24915-
- the language option `strict-inference` has been enabled in the analysis options file,
24916-
- the declaration of a variable doesn't have a type, and
24914+
The analyzer produces this diagnostic when:
24915+
- the language option `strict-inference` is enabled in the analysis options file,
24916+
- the declaration of a variable has no type, and
2491724917
- the type of the variable can't be inferred.
2491824918

2491924919
#### Example
@@ -24954,13 +24954,13 @@ WarningCode:
2495424954
documentation: |-
2495524955
#### Description
2495624956

24957-
The analyzer produces this diagnostic when
24958-
- the language option `strict-inference` has been enabled in the analysis options file,
24959-
- the declaration of a formal parameter doesn't have a type, and
24957+
The analyzer produces this diagnostic when:
24958+
- the language option `strict-inference` is enabled in the analysis options file,
24959+
- the declaration of a formal parameter has no type, and
2496024960
- the type of the parameter can't be inferred.
2496124961

24962-
The type of a parameter of a method can be inferred if the method
24963-
overrides an inherited method.
24962+
The type of a method's parameter can be inferred if it overrides an
24963+
inherited method.
2496424964

2496524965
#### Example
2496624966

@@ -27120,13 +27120,13 @@ WarningCode:
2712027120
documentation: |-
2712127121
#### Description
2712227122

27123-
The analyzer produces this diagnostic when the type of the object being
27124-
matched can't ever be matched by the pattern.
27123+
The analyzer produces this diagnostic when the object's type can't be
27124+
matched by the pattern.
2712527125

2712627126
#### Example
2712727127

27128-
The following code produces this diagnostic because a `double` is being
27129-
matched by a pattern that requires an `int`, which can never succeed:
27128+
The following code produces this diagnostic because a `double` is matched
27129+
by an `int` pattern, which can never succeed:
2713027130

2713127131
```dart
2713227132
void f(String? s) {
@@ -27136,16 +27136,16 @@ WarningCode:
2713627136

2713727137
#### Common fixes
2713827138

27139-
If one of the types is wrong, then change one or both of the types so that
27140-
the pattern can succeed:
27139+
If one of the types is wrong, then change one or both so the pattern match
27140+
can succeed:
2714127141

2714227142
```dart
2714327143
void f(String? s) {
2714427144
if (s case String _) {}
2714527145
}
2714627146
```
2714727147

27148-
If the types aren't wrong, then remove the pattern match:
27148+
If the types are correct, then remove the pattern match:
2714927149

2715027150
```dart
2715127151
void f(double x) {}
@@ -27243,8 +27243,8 @@ WarningCode:
2724327243
#### Description
2724427244

2724527245
The analyzer produces this diagnostic when a lint that has been removed is
27246-
used in an analysis options file. Because the lint has been removed, the
27247-
reference to it (such as enabling it) will have no effect.
27246+
used in an analysis options file. Because the lint no longer exists,
27247+
referencing it will have no effect.
2724827248

2724927249
#### Example
2725027250

@@ -27496,7 +27496,7 @@ WarningCode:
2749627496
SDK_VERSION_CONSTRUCTOR_TEAROFFS:
2749727497
parameters: none
2749827498
problemMessage: "Tearing off a constructor requires the 'constructor-tearoffs' language feature."
27499-
correctionMessage: "Try updating your pubspec.yaml to set the minimum SDK constraint to 2.15 or higher, and running 'pub get'."
27499+
correctionMessage: "Try updating your 'pubspec.yaml' to set the minimum SDK constraint to 2.15 or higher, and running 'pub get'."
2750027500
hasPublishedDocs: true
2750127501
comment: |-
2750227502
There is also a [ParserErrorCode.experimentNotEnabled] code which

0 commit comments

Comments
 (0)