File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -21795,9 +21795,8 @@ ParserErrorCode:
2179521795 documentation: |-
2179621796 #### Description
2179721797
21798- The analyzer produces this diagnostic when the name of a named parameter
21799- starts with an underscore and the parameter isn't an initializing formal
21800- or field parameter.
21798+ The analyzer produces this diagnostic when a named parameter starts with
21799+ an underscore, unless it's an initializing formal or field parameter.
2180121800
2180221801 #### Example
2180321802
@@ -21812,7 +21811,8 @@ ParserErrorCode:
2181221811
2181321812 #### Common fixes
2181421813
21815- Only use a private named parameter when it refers to a field:
21814+ If the parameter is intended to refer to a field, then add the missing
21815+ field:
2181621816
2181721817 ```dart
2181821818 class C {
@@ -21821,6 +21821,16 @@ ParserErrorCode:
2182121821 int get x => _x;
2182221822 }
2182321823 ```
21824+
21825+ If the parameter isn't intended to refer to a field, then remove the
21826+ underscore:
21827+
21828+ ```dart
21829+ class C {
21830+ C({int x = 0});
21831+ }
21832+ ```
21833+
2182421834 REPRESENTATION_FIELD_MODIFIER:
2182521835 parameters: none
2182621836 problemMessage: "Representation fields can't have modifiers."
You can’t perform that action at this time.
0 commit comments