Index: pkg/analyzer/lib/src/dart/element/element.dart |
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart |
index 25e5ede2c97e483a82d2dd454f38330f0fce49b3..e42f809d98f76569012509d0e01a3c9f1e5f5eaa 100644 |
--- a/pkg/analyzer/lib/src/dart/element/element.dart |
+++ b/pkg/analyzer/lib/src/dart/element/element.dart |
@@ -80,7 +80,7 @@ abstract class AbstractClassElementImpl extends ElementImpl |
* explicit superclass. |
*/ |
@override |
- InterfaceType supertype; |
+ InterfaceType _supertype; |
/** |
* The type defined by the class. |
@@ -1138,6 +1138,26 @@ class ClassElementImpl extends AbstractClassElementImpl { |
} |
@override |
+ InterfaceType get supertype { |
+ if (_unlinkedClass != null && _supertype == null) { |
+ if (_unlinkedClass.supertype != null) { |
+ _supertype = enclosingUnit.resynthesizerContext |
+ .resolveTypeRef(_unlinkedClass.supertype, this); |
+ } else if (_unlinkedClass.hasNoSupertype) { |
+ return null; |
+ } else { |
+ _supertype = context.typeProvider.objectType; |
+ } |
+ } |
+ return _supertype; |
+ } |
+ |
+ void set supertype(InterfaceType supertype) { |
+ assert(_unlinkedClass == null); |
+ _supertype = supertype; |
+ } |
+ |
+ @override |
List<TypeParameterElement> get typeParameters { |
if (_unlinkedClass != null) { |
return resynthesizedTypeParameters; |
@@ -3056,6 +3076,9 @@ class EnumElementImpl extends AbstractClassElementImpl { |
} |
@override |
+ InterfaceType get supertype => context.typeProvider.objectType; |
+ |
+ @override |
List<TypeParameterElement> get typeParameters => |
const <TypeParameterElement>[]; |