| Code-Review | +1 |
if (fieldDeclaration.externalKeyword != null) {
// External fields do not add stored state to the enum instance.
return;
}
var variableList = fieldDeclaration.fields;Maybe reverse the logic here to avoid the `return;`:
if (fieldDeclaration.externalKeyword == null) {
var variableList = fieldDeclaration.fields;
if (!variableList.isFinal) {
...
}
}| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
if (fieldDeclaration.externalKeyword != null) {
// External fields do not add stored state to the enum instance.
return;
}
var variableList = fieldDeclaration.fields;Maybe reverse the logic here to avoid the `return;`:
if (fieldDeclaration.externalKeyword == null) {
var variableList = fieldDeclaration.fields;
if (!variableList.isFinal) {
...
}
}
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: pkg/analyzer/lib/src/generated/error_verifier.dart
Insertions: 8, Deletions: 9.
@@ -5655,15 +5655,14 @@
if (fieldDeclaration != null) {
if (!fieldDeclaration.isStatic) {
- if (fieldDeclaration.externalKeyword != null) {
- // External fields do not add stored state to the enum instance.
- return;
- }
- var variableList = fieldDeclaration.fields;
- if (!variableList.isFinal) {
- diagnosticReporter.report(
- diag.nonFinalFieldInEnum.at(variableList.variables.first.name),
- );
+ // External fields do not add stored state to the enum instance.
+ if (fieldDeclaration.externalKeyword == null) {
+ var variableList = fieldDeclaration.fields;
+ if (!variableList.isFinal) {
+ diagnosticReporter.report(
+ diag.nonFinalFieldInEnum.at(variableList.variables.first.name),
+ );
+ }
}
}
} else if (primaryConstructor != null) {
```
BL-co19. Don't report nonFinalFieldInEnum for external fields.
External fields don't have storage.
Now pass:
co19/LanguageFeatures/Enhanced-Enum/grammar_A07_t01
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |