Skip to content

Commit ad759d3

Browse files
pqCommit Queue
authored and
Commit Queue
committed
quick fix for COVARIANT_MEMBER
See: #55917 Change-Id: Id6f749fe0f7cb51403b0952abb2e2ba8a24d3120 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369767 Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Auto-Submit: Phil Quitslund <[email protected]>
1 parent 290d740 commit ad759d3

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
#
4646
# Stats:
4747
# - 42 "needsEvaluation"
48-
# - 344 "needsFix"
49-
# - 407 "hasFix"
48+
# - 343 "needsFix"
49+
# - 408 "hasFix"
5050
# - 516 "noFix"
5151

5252
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
@@ -2615,9 +2615,7 @@ ParserErrorCode.COVARIANT_CONSTRUCTOR:
26152615
notes: |-
26162616
Remove `covariant`.
26172617
ParserErrorCode.COVARIANT_MEMBER:
2618-
status: needsFix
2619-
notes: |-
2620-
Remove `covariant`.
2618+
status: hasFix
26212619
ParserErrorCode.DECLARATION_NAMED_AUGMENTED_INSIDE_AUGMENTATION:
26222620
status: noFix
26232621
ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
13631363
ParserErrorCode.CONST_METHOD: [
13641364
RemoveConst.new,
13651365
],
1366+
ParserErrorCode.COVARIANT_MEMBER: [
1367+
RemoveExtraModifier.new,
1368+
],
13661369
ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION: [
13671370
ReplaceWithWildcard.new,
13681371
],

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,19 @@ void m() {}
149149
''');
150150
}
151151

152+
Future<void> test_covariantMember() async {
153+
await resolveTestCode(r'''
154+
class C {
155+
covariant c() {}
156+
}
157+
''');
158+
await assertHasFix('''
159+
class C {
160+
c() {}
161+
}
162+
''');
163+
}
164+
152165
Future<void> test_covariantTopLevelDeclaration_class() async {
153166
await resolveTestCode(r'''
154167
covariant class C {}

0 commit comments

Comments
 (0)