quick fix for STATIC_OPERATOR

See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I41dd40a11e98340dc90f3673c8c6b37e3bf3d7f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370161
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
pq 2024-06-08 19:57:46 +00:00 committed by Commit Queue
parent dd89732126
commit 6424397cbf
3 changed files with 27 additions and 13 deletions

View file

@ -45,8 +45,8 @@
#
# Stats:
# - 42 "needsEvaluation"
# - 336 "needsFix"
# - 415 "hasFix"
# - 335 "needsFix"
# - 416 "hasFix"
# - 516 "noFix"
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
@ -905,35 +905,35 @@ CompileTimeErrorCode.INVALID_ASSIGNMENT:
CompileTimeErrorCode.INVALID_CAST_FUNCTION:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_FUNCTION_EXPR:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_LITERAL:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_LITERAL_LIST:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_LITERAL_MAP:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_LITERAL_SET:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_METHOD:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CAST_NEW_EXPR:
status: noFix
notes: |-
Removed i Dart 3.0
Removed in Dart 3.0
CompileTimeErrorCode.INVALID_CONSTANT:
status: noFix
notes: |-
@ -3223,9 +3223,7 @@ ParserErrorCode.STATIC_GETTER_WITHOUT_BODY:
notes: |-
Add an empty body.
ParserErrorCode.STATIC_OPERATOR:
status: needsFix
notes: |-
Remove the `static` keyword.
status: hasFix
ParserErrorCode.STATIC_SETTER_WITHOUT_BODY:
status: needsFix
notes: |-

View file

@ -1472,6 +1472,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
ParserErrorCode.STATIC_CONSTRUCTOR: [
RemoveLexeme.keyword,
],
ParserErrorCode.STATIC_OPERATOR: [
RemoveLexeme.keyword,
],
ParserErrorCode.VAR_AND_TYPE: [
RemoveTypeAnnotation.fixVarAndType,
RemoveVar.new,

View file

@ -405,6 +405,19 @@ class C {
''');
}
Future<void> test_staticOperator() async {
await resolveTestCode('''
class C {
static operator +(int x) => 1;
}
''');
await assertHasFix('''
class C {
operator +(int x) => 1;
}
''');
}
Future<void> test_staticTopLevelDeclaration_enum() async {
await resolveTestCode(r'''
static enum E { v }