Skip to content

Commit

Permalink
quick fix for STATIC_CONSTRUCTOR
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pq authored and Commit Queue committed Jun 6, 2024
1 parent e8939b0 commit a1b42e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#
# Stats:
# - 42 "needsEvaluation"
# - 337 "needsFix"
# - 414 "hasFix"
# - 336 "needsFix"
# - 415 "hasFix"
# - 516 "noFix"

AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
Expand Down Expand Up @@ -3217,9 +3217,7 @@ ParserErrorCode.SETTER_IN_FUNCTION:
ParserErrorCode.STACK_OVERFLOW:
status: noFix
ParserErrorCode.STATIC_CONSTRUCTOR:
status: needsFix
notes: |-
Remove the `static` keyword.
status: hasFix
ParserErrorCode.STATIC_GETTER_WITHOUT_BODY:
status: needsFix
notes: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
ParserErrorCode.SETTER_CONSTRUCTOR: [
RemoveLexeme.keyword,
],
ParserErrorCode.STATIC_CONSTRUCTOR: [
RemoveLexeme.keyword,
],
ParserErrorCode.VAR_AND_TYPE: [
RemoveTypeAnnotation.fixVarAndType,
RemoveVar.new,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,19 @@ class C {
''');
}

Future<void> test_staticConstructor() async {
await resolveTestCode('''
class C {
static C.c(){}
}
''');
await assertHasFix('''
class C {
C.c(){}
}
''');
}

Future<void> test_staticTopLevelDeclaration_enum() async {
await resolveTestCode(r'''
static enum E { v }
Expand Down

0 comments on commit a1b42e1

Please sign in to comment.