quick fix for INVALID_MODIFIER_ON_SETTER

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

Change-Id: Ieabdb7b9d12ef409d99497a32b6701a89c936434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370481
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
pq 2024-06-11 09:28:47 +00:00 committed by Commit Queue
parent 847c35612a
commit fb3016a584
3 changed files with 19 additions and 5 deletions

View file

@ -45,8 +45,8 @@
#
# Stats:
# - 42 "needsEvaluation"
# - 331 "needsFix"
# - 417 "hasFix"
# - 330 "needsFix"
# - 418 "hasFix"
# - 516 "noFix"
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
@ -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:

View file

@ -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,
],

View file

@ -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 {