Skip to content

Commit a1b42e1

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

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

5252
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
@@ -3217,9 +3217,7 @@ ParserErrorCode.SETTER_IN_FUNCTION:
32173217
ParserErrorCode.STACK_OVERFLOW:
32183218
status: noFix
32193219
ParserErrorCode.STATIC_CONSTRUCTOR:
3220-
status: needsFix
3221-
notes: |-
3222-
Remove the `static` keyword.
3220+
status: hasFix
32233221
ParserErrorCode.STATIC_GETTER_WITHOUT_BODY:
32243222
status: needsFix
32253223
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
@@ -1469,6 +1469,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
14691469
ParserErrorCode.SETTER_CONSTRUCTOR: [
14701470
RemoveLexeme.keyword,
14711471
],
1472+
ParserErrorCode.STATIC_CONSTRUCTOR: [
1473+
RemoveLexeme.keyword,
1474+
],
14721475
ParserErrorCode.VAR_AND_TYPE: [
14731476
RemoveTypeAnnotation.fixVarAndType,
14741477
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
@@ -392,6 +392,19 @@ class C {
392392
''');
393393
}
394394

395+
Future<void> test_staticConstructor() async {
396+
await resolveTestCode('''
397+
class C {
398+
static C.c(){}
399+
}
400+
''');
401+
await assertHasFix('''
402+
class C {
403+
C.c(){}
404+
}
405+
''');
406+
}
407+
395408
Future<void> test_staticTopLevelDeclaration_enum() async {
396409
await resolveTestCode(r'''
397410
static enum E { v }

0 commit comments

Comments
 (0)