Skip to content

Commit

Permalink
+ quick fix for INVALID_REOPEN_ANNOTATION
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pq authored and Commit Queue committed May 16, 2024
1 parent 020a59e commit fe91f3e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3711,9 +3711,7 @@ WarningCode.INVALID_NON_VIRTUAL_ANNOTATION:
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
WarningCode.INVALID_NON_VIRTUAL_ANNOTATION: [
RemoveAnnotation.new,
],
WarningCode.INVALID_REOPEN_ANNOTATION: [
RemoveAnnotation.new,
],
WarningCode.INVALID_REQUIRED_NAMED_PARAM: [
RemoveAnnotation.new,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,24 @@ extension type E(C c) implements C {
''');
}

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';
Expand Down

0 comments on commit fe91f3e

Please sign in to comment.