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 5e72951c68f2d97ecda4692cb9d9f861873334a6..5dfed4dad1f4ce6eeb724aae4daa7ba7c40d3d3c 100644 |
--- a/pkg/analyzer/lib/src/dart/element/element.dart |
+++ b/pkg/analyzer/lib/src/dart/element/element.dart |
@@ -96,14 +96,12 @@ class ClassElementImpl extends ElementImpl |
* A list containing all of the mixins that are applied to the class being |
* extended in order to derive the superclass of this class. |
*/ |
- @override |
- List<InterfaceType> mixins = InterfaceType.EMPTY_LIST; |
+ List<InterfaceType> _mixins; |
/** |
* A list containing all of the interfaces that are implemented by this class. |
*/ |
- @override |
- List<InterfaceType> interfaces = InterfaceType.EMPTY_LIST; |
+ List<InterfaceType> _interfaces; |
/** |
* A list containing all of the methods contained in this class. |
@@ -374,6 +372,22 @@ class ClassElementImpl extends ElementImpl |
} |
@override |
+ List<InterfaceType> get interfaces { |
+ if (_unlinkedClass != null && _interfaces == null) { |
+ ResynthesizerContext context = enclosingUnit.resynthesizerContext; |
+ _interfaces = _unlinkedClass.interfaces |
+ .map((EntityRef t) => context.resolveTypeRef(t, this)) |
+ .toList(); |
+ } |
+ return _interfaces ?? const <InterfaceType>[]; |
+ } |
+ |
+ void set interfaces(List<InterfaceType> interfaces) { |
+ assert(_unlinkedClass == null); |
+ _interfaces = interfaces; |
+ } |
+ |
+ @override |
bool get isAbstract { |
if (_unlinkedClass != null) { |
return _unlinkedClass.isAbstract; |
@@ -458,6 +472,22 @@ class ClassElementImpl extends ElementImpl |
} |
@override |
+ List<InterfaceType> get mixins { |
+ if (_unlinkedClass != null && _mixins == null) { |
+ ResynthesizerContext context = enclosingUnit.resynthesizerContext; |
+ _mixins = _unlinkedClass.mixins |
+ .map((EntityRef t) => context.resolveTypeRef(t, this)) |
+ .toList(); |
+ } |
+ return _mixins ?? const <InterfaceType>[]; |
+ } |
+ |
+ void set mixins(List<InterfaceType> mixins) { |
+ assert(_unlinkedClass == null); |
+ _mixins = mixins; |
+ } |
+ |
+ @override |
String get name { |
if (_unlinkedClass != null) { |
return _unlinkedClass.name; |
@@ -3659,7 +3689,7 @@ class FunctionTypeAliasElementImpl extends ElementImpl |
/** |
* The type of function defined by this type alias. |
*/ |
- FunctionType type; |
+ FunctionType _type; |
/** |
* A list containing all of the type parameters defined for this type. |
@@ -3799,6 +3829,19 @@ class FunctionTypeAliasElementImpl extends ElementImpl |
} |
@override |
+ FunctionType get type { |
+ if (_unlinkedTypedef != null && _type == null) { |
+ _type = new FunctionTypeImpl.forTypedef(this); |
+ } |
+ return _type; |
+ } |
+ |
+ void set type(FunctionType type) { |
+ assert(_unlinkedTypedef == null); |
+ _type = type; |
+ } |
+ |
+ @override |
TypeParameterizedElementMixin get typeParameterContext => this; |
@override |
@@ -5785,6 +5828,22 @@ abstract class NonParameterVariableElementImpl extends VariableElementImpl { |
} |
return super.nameOffset; |
} |
+ |
+ @override |
+ DartType get type { |
+ if (_unlinkedVariable != null && _type == null) { |
+ _type = enclosingUnit.resynthesizerContext.resolveLinkedType( |
+ _unlinkedVariable.inferredTypeSlot, typeParameterContext) ?? |
+ enclosingUnit.resynthesizerContext |
+ .resolveTypeRef(_unlinkedVariable.type, typeParameterContext); |
+ } |
+ return super.type; |
+ } |
+ |
+ void set type(DartType type) { |
+ assert(_unlinkedVariable == null); |
+ _type = type; |
+ } |
} |
/** |