diff --git a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml index d41422dda4c..f93dd3b8fc3 100644 --- a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml +++ b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml @@ -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: diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart index c5613a32a9d..a567a58aa6e 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart @@ -1035,6 +1035,9 @@ final _builtInNonLintProducers = >{ CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR: [ RemoveLexeme.modifier, ], + CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER: [ + RemoveLexeme.modifier, + ], CompileTimeErrorCode.INVALID_USE_OF_COVARIANT: [ RemoveLexeme.keyword, ], diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart index d0e939f1470..649ee937906 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart @@ -332,6 +332,19 @@ class A { '''); } + Future test_invalidModifierOnSetter() async { + await resolveTestCode(''' +class C { + set x(v) async {} +} +'''); + await assertHasFix(''' +class C { + set x(v) {} +} +'''); + } + Future test_invalidUseOfCovariant() async { await resolveTestCode(''' class C {