@@ -860,18 +860,19 @@ class ClassElementImpl extends AbstractClassElementImpl
860
860
InterfaceType get supertype {
861
861
if (_supertype != null ) return _supertype;
862
862
863
- if (linkedNode != null ) {
864
- var context = enclosingUnit.linkedContext;
865
-
866
- var coreTypes = context.bundleContext.elementFactory.coreTypes;
867
- if (identical (this , coreTypes.objectClass)) {
868
- return null ;
869
- }
863
+ if (hasModifier (Modifier .DART_CORE_OBJECT )) {
864
+ return null ;
865
+ }
870
866
871
- var type = context.getSuperclass (linkedNode)? .type;
867
+ if (linkedNode != null ) {
868
+ var type = linkedContext.getSuperclass (linkedNode)? .type;
872
869
if (_isInterfaceTypeClass (type)) {
873
870
return _supertype = type;
874
871
}
872
+ if (library.isDartCore && name == 'Object' ) {
873
+ setModifier (Modifier .DART_CORE_OBJECT , true );
874
+ return null ;
875
+ }
875
876
return _supertype = library.typeProvider.objectType;
876
877
}
877
878
return _supertype;
@@ -5898,61 +5899,65 @@ class Modifier implements Comparable<Modifier> {
5898
5899
/// Indicates that the modifier 'covariant' was applied to the element.
5899
5900
static const Modifier COVARIANT = Modifier ('COVARIANT' , 3 );
5900
5901
5902
+ /// Indicates that the class is `Object` from `dart:core` .
5903
+ static const Modifier DART_CORE_OBJECT = Modifier ('DART_CORE_OBJECT' , 4 );
5904
+
5901
5905
/// Indicates that the import element represents a deferred library.
5902
- static const Modifier DEFERRED = Modifier ('DEFERRED' , 4 );
5906
+ static const Modifier DEFERRED = Modifier ('DEFERRED' , 5 );
5903
5907
5904
5908
/// Indicates that a class element was defined by an enum declaration.
5905
- static const Modifier ENUM = Modifier ('ENUM' , 5 );
5909
+ static const Modifier ENUM = Modifier ('ENUM' , 6 );
5906
5910
5907
5911
/// Indicates that a class element was defined by an enum declaration.
5908
- static const Modifier EXTERNAL = Modifier ('EXTERNAL' , 6 );
5912
+ static const Modifier EXTERNAL = Modifier ('EXTERNAL' , 7 );
5909
5913
5910
5914
/// Indicates that the modifier 'factory' was applied to the element.
5911
- static const Modifier FACTORY = Modifier ('FACTORY' , 7 );
5915
+ static const Modifier FACTORY = Modifier ('FACTORY' , 8 );
5912
5916
5913
5917
/// Indicates that the modifier 'final' was applied to the element.
5914
- static const Modifier FINAL = Modifier ('FINAL' , 8 );
5918
+ static const Modifier FINAL = Modifier ('FINAL' , 9 );
5915
5919
5916
5920
/// Indicates that an executable element has a body marked as being a
5917
5921
/// generator.
5918
- static const Modifier GENERATOR = Modifier ('GENERATOR' , 9 );
5922
+ static const Modifier GENERATOR = Modifier ('GENERATOR' , 10 );
5919
5923
5920
5924
/// Indicates that the pseudo-modifier 'get' was applied to the element.
5921
- static const Modifier GETTER = Modifier ('GETTER' , 10 );
5925
+ static const Modifier GETTER = Modifier ('GETTER' , 11 );
5922
5926
5923
5927
/// A flag used for libraries indicating that the defining compilation unit
5924
5928
/// contains at least one import directive whose URI uses the "dart-ext"
5925
5929
/// scheme.
5926
- static const Modifier HAS_EXT_URI = Modifier ('HAS_EXT_URI' , 11 );
5930
+ static const Modifier HAS_EXT_URI = Modifier ('HAS_EXT_URI' , 12 );
5927
5931
5928
5932
/// Indicates that the associated element did not have an explicit type
5929
5933
/// associated with it. If the element is an [ExecutableElement] , then the
5930
5934
/// type being referred to is the return type.
5931
- static const Modifier IMPLICIT_TYPE = Modifier ('IMPLICIT_TYPE' , 12 );
5935
+ static const Modifier IMPLICIT_TYPE = Modifier ('IMPLICIT_TYPE' , 13 );
5932
5936
5933
5937
/// Indicates that modifier 'lazy' was applied to the element.
5934
- static const Modifier LATE = Modifier ('LATE' , 13 );
5938
+ static const Modifier LATE = Modifier ('LATE' , 14 );
5935
5939
5936
5940
/// Indicates that a class is a mixin application.
5937
- static const Modifier MIXIN_APPLICATION = Modifier ('MIXIN_APPLICATION' , 14 );
5941
+ static const Modifier MIXIN_APPLICATION = Modifier ('MIXIN_APPLICATION' , 15 );
5938
5942
5939
5943
/// Indicates that the pseudo-modifier 'set' was applied to the element.
5940
- static const Modifier SETTER = Modifier ('SETTER' , 15 );
5944
+ static const Modifier SETTER = Modifier ('SETTER' , 16 );
5941
5945
5942
5946
/// Indicates that the modifier 'static' was applied to the element.
5943
- static const Modifier STATIC = Modifier ('STATIC' , 16 );
5947
+ static const Modifier STATIC = Modifier ('STATIC' , 17 );
5944
5948
5945
5949
/// Indicates that the element does not appear in the source code but was
5946
5950
/// implicitly created. For example, if a class does not define any
5947
5951
/// constructors, an implicit zero-argument constructor will be created and it
5948
5952
/// will be marked as being synthetic.
5949
- static const Modifier SYNTHETIC = Modifier ('SYNTHETIC' , 17 );
5953
+ static const Modifier SYNTHETIC = Modifier ('SYNTHETIC' , 18 );
5950
5954
5951
5955
static const List <Modifier > values = [
5952
5956
ABSTRACT ,
5953
5957
ASYNCHRONOUS ,
5954
5958
CONST ,
5955
5959
COVARIANT ,
5960
+ DART_CORE_OBJECT ,
5956
5961
DEFERRED ,
5957
5962
ENUM ,
5958
5963
EXTERNAL ,
0 commit comments