diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart index 0a5c264cf24..6a419130e98 100644 --- a/pkg/analyzer/lib/src/dart/element/element.dart +++ b/pkg/analyzer/lib/src/dart/element/element.dart @@ -2790,10 +2790,7 @@ class EnumElementImpl extends AbstractClassElementImpl { bool get hasStaticMember => true; @override - List get interfaces { - var enumType = library.typeProvider.enumType; - return enumType != null ? [enumType] : const []; - } + List get interfaces => const []; @override bool get isAbstract => false; @@ -2834,7 +2831,10 @@ class EnumElementImpl extends AbstractClassElementImpl { } @override - InterfaceType get supertype => library.typeProvider.objectType; + InterfaceType get supertype { + var enumType = library.typeProvider.enumType; + return enumType ?? library.typeProvider.objectType; + } @override List get typeParameters => diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart index 115365f0517..276bad031fa 100644 --- a/pkg/analyzer/lib/src/generated/error_verifier.dart +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart @@ -3188,6 +3188,10 @@ class ErrorVerifier extends RecursiveAstVisitor /// See [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]. bool _checkForMixinInheritsNotFromObject( NamedType mixinName, ClassElement mixinElement) { + if (mixinElement.isEnum) { + return false; + } + var mixinSupertype = mixinElement.supertype; if (mixinSupertype == null || mixinSupertype.isDartCoreObject) { var mixins = mixinElement.mixins; diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart index 6463ec1a266..6d989da6f11 100644 --- a/pkg/analyzer/test/src/summary/resynthesize_common.dart +++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart @@ -7681,8 +7681,7 @@ library enum E @5 codeOffset: 0 codeLength: 26 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -12846,8 +12845,7 @@ library synthetic @-1 enums enum E @30 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -15065,8 +15063,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -15119,8 +15116,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16087,8 +16083,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16111,8 +16106,7 @@ library synthetic toString @-1 returnType: String enum E @19 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16369,8 +16363,7 @@ library enums enum E @65 documentationComment: /**\n * Docs\n */ - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16406,8 +16399,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16454,8 +16446,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16515,8 +16506,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16548,8 +16538,7 @@ library definingUnit enums enum E1 @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16568,8 +16557,7 @@ library synthetic toString @-1 returnType: String enum E2 @20 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -16655,8 +16643,7 @@ library superKeyword: super @0 enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -23412,8 +23399,7 @@ library definingUnit enums enum E @19 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -23483,8 +23469,7 @@ library returnType: dynamic enums enum E @64 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -23558,8 +23543,7 @@ library staticElement: self::@getter::a staticType: null token: a @15 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -25055,8 +25039,7 @@ library staticElement: self::@getter::foo staticType: null token: foo @17 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -26247,8 +26230,7 @@ library synthetic @-1 enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -27547,8 +27529,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -29509,8 +29490,7 @@ library synthetic @-1 enums enum E @16 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -29617,8 +29597,7 @@ library synthetic @-1 enums enum E @27 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -29659,8 +29638,7 @@ library synthetic @-1 enums enum E @42 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -29738,8 +29716,7 @@ library synthetic @-1 enums enum E @27 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -29815,8 +29792,7 @@ library synthetic @-1 enums enum E @27 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int @@ -29960,8 +29936,7 @@ library definingUnit enums enum E @5 - interfaces - Enum + supertype: Enum fields synthetic final index @-1 type: int