Skip to content

Commit e8939b0

Browse files
pqCommit Queue
authored and
Commit Queue
committed
quick fix for SETTER_CONSTRUCTOR
See: #55917 Change-Id: I0984ef126107974a611c2582402e4498514377d2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370061 Commit-Queue: Phil Quitslund <[email protected]> Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 76c0e85 commit e8939b0

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-
# - 338 "needsFix"
49-
# - 413 "hasFix"
48+
# - 337 "needsFix"
49+
# - 414 "hasFix"
5050
# - 516 "noFix"
5151

5252
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
@@ -3209,9 +3209,7 @@ ParserErrorCode.SEALED_MIXIN:
32093209
ParserErrorCode.SEALED_MIXIN_CLASS:
32103210
status: hasFix
32113211
ParserErrorCode.SETTER_CONSTRUCTOR:
3212-
status: needsFix
3213-
notes: |-
3214-
Remove the `set`.
3212+
status: hasFix
32153213
ParserErrorCode.SETTER_IN_FUNCTION:
32163214
status: needsFix
32173215
notes: |-

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
14661466
ParserErrorCode.SEALED_MIXIN_CLASS: [
14671467
RemoveLexeme.modifier,
14681468
],
1469+
ParserErrorCode.SETTER_CONSTRUCTOR: [
1470+
RemoveLexeme.keyword,
1471+
],
14691472
ParserErrorCode.VAR_AND_TYPE: [
14701473
RemoveTypeAnnotation.fixVarAndType,
14711474
RemoveVar.new,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,19 @@ mixin M {}
379379
''');
380380
}
381381

382+
Future<void> test_setterConstructor() async {
383+
await resolveTestCode('''
384+
class C {
385+
set C.c();
386+
}
387+
''');
388+
await assertHasFix('''
389+
class C {
390+
C.c();
391+
}
392+
''');
393+
}
394+
382395
Future<void> test_staticTopLevelDeclaration_enum() async {
383396
await resolveTestCode(r'''
384397
static enum E { v }

0 commit comments

Comments
 (0)