Unreviewed changes
4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: pkg/front_end/messages.status
Insertions: 0, Deletions: 13.
@@ -163,19 +163,6 @@
front_end/WasmImportOrExportInUserCode/example: missingExample # only issued by wasm build
front_end/WebLiteralCannotBeRepresentedExactly/example: missingExample # only issued on web build
-# An invalid private named parameter produces one of two errors depending on
-# whether the "private-named-parameters" experiment is enabled. By default with
-# the experiment off, it shows the old error (PrivateOptionalParameter), even
-# for the example in the new error code. Allow that for now.
-# TODO(rnystrom): Decide if we want to consolidate to one single error when the
-# experiment is closer to shipping.
-front_end/PrivateNamedNonFieldParameter/part_wrapped_script: hasOnlyUnrelatedMessages
-front_end/PrivateNamedNonFieldParameter/script: hasOnlyUnrelatedMessages
-front_end/PrivateNamedParameterDuplicatePublicName/part_wrapped_script: hasOnlyUnrelatedMessages
-front_end/PrivateNamedParameterDuplicatePublicName/script: hasOnlyUnrelatedMessages
-front_end/PrivateNamedParameterWithoutPublicName/part_wrapped_script: hasOnlyUnrelatedMessages
-front_end/PrivateNamedParameterWithoutPublicName/script: hasOnlyUnrelatedMessages
-
# Can we do better?
_fe_analyzer_shared/ConstAndFinal/declaration3: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did?
_fe_analyzer_shared/ConstAndFinal/declaration4: hasOnlyUnrelatedMessages # maybe the parser should do better here - it seems it once did?
```
```
The name of the file: pkg/front_end/messages.yaml
Insertions: 3, Deletions: 0.
@@ -1575,12 +1575,14 @@
pseudoSharedCode: PRIVATE_NAMED_NON_FIELD_PARAMETER
parameters: none
problemMessage: "A named parameter that doesn't refer to an instance variable can't start with an underscore ('_')."
+ experiments: private-named-parameters
script: |
void foo({int? _hello}) {}
PrivateNamedParameterWithoutPublicName:
parameters: none
problemMessage: "A private named parameter must have a corresponding public name."
+ experiments: private-named-parameters
script: |
class C {
int? _123;
@@ -1591,6 +1593,7 @@
parameters:
String name: the corresponding public name of private named parameter
problemMessage: "The corresponding public name '#name' is already the name of another parameter."
+ experiments: private-named-parameters
script: |
class C {
int? _x;
```
Change information
Commit message:
[private named parameters] Report collision between public name and other parameters in CFE.
Change-Id: I4a3260b3bc280b6a7fb202c16e2b1ee862bfc018
Files:
- M pkg/front_end/lib/src/codes/cfe_codes_generated.dart
- M pkg/front_end/lib/src/source/outline_builder.dart
- M pkg/front_end/messages.status
- M pkg/front_end/messages.yaml
- M pkg/front_end/test/spell_checking_list_common.txt
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart.strong.expect
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart.strong.modular.expect
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart.strong.outline.expect
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart.strong.transformed.expect
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart.textual_outline.expect
- A pkg/front_end/testcases/private_named_parameters/initializing_formal_collision.dart.textual_outline_modelled.expect
Change size: L
Delta: 12 files changed, 843 insertions(+), 11 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Johnni Winther