Skip to content

Commit

Permalink
quick fix for INVALID_MODIFIER_ON_SETTER
Browse files Browse the repository at this point in the history
See: #55917

Change-Id: Ieabdb7b9d12ef409d99497a32b6701a89c936434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370481
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
  • Loading branch information
pq authored and Commit Queue committed Jun 11, 2024
1 parent 847c356 commit fb3016a
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"
# - 331 "needsFix"
# - 417 "hasFix"
# - 330 "needsFix"
# - 418 "hasFix"
# - 516 "noFix"

AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
Expand Down Expand Up @@ -973,9 +973,7 @@ CompileTimeErrorCode.INVALID_MACRO_APPLICATION_TARGET:
CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR:
status: hasFix
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER:
status: needsFix
notes: |-
Remove the modifier.
status: hasFix
CompileTimeErrorCode.INVALID_OVERRIDE:
status: hasFix
CompileTimeErrorCode.INVALID_OVERRIDE_SETTER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR: [
RemoveLexeme.modifier,
],
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER: [
RemoveLexeme.modifier,
],
CompileTimeErrorCode.INVALID_USE_OF_COVARIANT: [
RemoveLexeme.keyword,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,19 @@ class A {
''');
}

Future<void> test_invalidModifierOnSetter() async {
await resolveTestCode('''
class C {
set x(v) async {}
}
''');
await assertHasFix('''
class C {
set x(v) {}
}
''');
}

Future<void> test_invalidUseOfCovariant() async {
await resolveTestCode('''
class C {
Expand Down

0 comments on commit fb3016a

Please sign in to comment.