File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed
lib/src/services/correction
test/src/services/correction/fix Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -1125,7 +1125,7 @@ CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS:
11251125CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE :
11261126 status : hasFix
11271127CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS :
1128- status : noFix
1128+ status : hasFix
11291129CompileTimeErrorCode.MIXINS_SUPER_CLASS :
11301130 status : needsFix
11311131 notes : |-
Original file line number Diff line number Diff line change @@ -1361,6 +1361,10 @@ final _builtInNonLintMultiGenerators = {
13611361 DataDriven .new ,
13621362 ImportLibrary .forType,
13631363 ],
1364+ CompileTimeErrorCode .MIXIN_WITH_NON_CLASS_SUPERCLASS : [
1365+ CreateClass .new ,
1366+ ImportLibrary .forType,
1367+ ],
13641368 CompileTimeErrorCode .NEW_WITH_NON_TYPE : [
13651369 CreateClass .new ,
13661370 ImportLibrary .forType,
Original file line number Diff line number Diff line change @@ -304,6 +304,22 @@ void f() {
304304 await assertNoFix ();
305305 }
306306
307+ Future <void > test_classContainingWith () async {
308+ await resolveTestCode ('''
309+ class B extends A with M {}
310+
311+ mixin M {}
312+ ''' );
313+ await assertHasFix ('''
314+ class B extends A with M {}
315+
316+ class A {
317+ }
318+
319+ mixin M {}
320+ ''' );
321+ }
322+
307323 Future <void > test_extends () async {
308324 await resolveTestCode ('''
309325class MyClass extends BaseClass {}
Original file line number Diff line number Diff line change @@ -313,6 +313,24 @@ void f() {
313313 await assertNoFix ();
314314 }
315315
316+ Future <void > test_classContainingWith () async {
317+ newFile ('$testPackageLibPath /lib.dart' , '''
318+ class A {}
319+ ''' );
320+ await resolveTestCode ('''
321+ class B extends A with M {}
322+
323+ mixin M {}
324+ ''' );
325+ await assertHasFix ('''
326+ import 'package:test/lib.dart';
327+
328+ class B extends A with M {}
329+
330+ mixin M {}
331+ ''' );
332+ }
333+
316334 Future <void > test_extension_name () async {
317335 createAnalysisOptionsFile (lints: [LintNames .comment_references]);
318336 newFile ('$testPackageLibPath /lib.dart' , '''
You can’t perform that action at this time.
0 commit comments