Skip to content

Commit fe91f3e

Browse files
pqCommit Queue
authored and
Commit Queue
committed
+ quick fix for INVALID_REOPEN_ANNOTATION
Change-Id: I1778edea4371ce84efaab5e2a64e14ee035d0500 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366883 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent 020a59e commit fe91f3e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,9 +3711,7 @@ WarningCode.INVALID_NON_VIRTUAL_ANNOTATION:
37113711
WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER:
37123712
status: noFix
37133713
WarningCode.INVALID_REOPEN_ANNOTATION:
3714-
status: needsFix
3715-
notes: |-
3716-
The fix is to remove the annotation.
3714+
status: hasFix
37173715
WarningCode.INVALID_REQUIRED_NAMED_PARAM:
37183716
status: hasFix
37193717
WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM:

pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
14291429
WarningCode.INVALID_NON_VIRTUAL_ANNOTATION: [
14301430
RemoveAnnotation.new,
14311431
],
1432+
WarningCode.INVALID_REOPEN_ANNOTATION: [
1433+
RemoveAnnotation.new,
1434+
],
14321435
WarningCode.INVALID_REQUIRED_NAMED_PARAM: [
14331436
RemoveAnnotation.new,
14341437
],

pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,24 @@ extension type E(C c) implements C {
240240
''');
241241
}
242242

243+
Future<void> test_reopen() async {
244+
await resolveTestCode('''
245+
import 'package:meta/meta.dart';
246+
247+
class A {}
248+
249+
@reopen
250+
base class B extends A {}
251+
''');
252+
await assertHasFix('''
253+
import 'package:meta/meta.dart';
254+
255+
class A {}
256+
257+
base class B extends A {}
258+
''');
259+
}
260+
243261
Future<void> test_required_namedWithDefault() async {
244262
await resolveTestCode('''
245263
import 'package:meta/meta.dart';

0 commit comments

Comments
 (0)