+ quick fix for `INVALID_REOPEN_ANNOTATION`
Change-Id: I1778edea4371ce84efaab5e2a64e14ee035d0500
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
diff --git a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
index e727e45..93a0e36 100644
--- a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
+++ b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml
@@ -3711,9 +3711,7 @@
WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER:
status: noFix
WarningCode.INVALID_REOPEN_ANNOTATION:
- status: needsFix
- notes: |-
- The fix is to remove the annotation.
+ status: hasFix
WarningCode.INVALID_REQUIRED_NAMED_PARAM:
status: hasFix
WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM:
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index eb1598b..d7a4b61 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -1429,6 +1429,9 @@
WarningCode.INVALID_NON_VIRTUAL_ANNOTATION: [
RemoveAnnotation.new,
],
+ WarningCode.INVALID_REOPEN_ANNOTATION: [
+ RemoveAnnotation.new,
+ ],
WarningCode.INVALID_REQUIRED_NAMED_PARAM: [
RemoveAnnotation.new,
],
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
index 3c59433..938ba7e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
@@ -240,6 +240,24 @@
''');
}
+ Future<void> test_reopen() async {
+ await resolveTestCode('''
+import 'package:meta/meta.dart';
+
+class A {}
+
+@reopen
+base class B extends A {}
+''');
+ await assertHasFix('''
+import 'package:meta/meta.dart';
+
+class A {}
+
+base class B extends A {}
+''');
+ }
+
Future<void> test_required_namedWithDefault() async {
await resolveTestCode('''
import 'package:meta/meta.dart';