Index: pkg/analyzer/lib/src/summary/link.dart |
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart |
index 0d8fa92cdb30bc0f9ee3eb3f15bffa5d3e36997f..ce8a61de425370a146f1454a69e60b464a0d368d 100644 |
--- a/pkg/analyzer/lib/src/summary/link.dart |
+++ b/pkg/analyzer/lib/src/summary/link.dart |
@@ -1077,30 +1077,35 @@ abstract class CompilationUnitElementForLink |
} |
@override |
- DartType resolveTypeRef(ElementImpl context, EntityRef type, |
+ DartType resolveTypeRef(ElementImpl context, EntityRef entity, |
{bool defaultVoid: false, |
bool instantiateToBoundsAllowed: true, |
bool declaredType: false}) { |
- if (type == null) { |
+ if (entity == null) { |
if (defaultVoid) { |
return VoidTypeImpl.instance; |
} else { |
return DynamicTypeImpl.instance; |
} |
} |
- if (type.paramReference != 0) { |
+ if (entity.paramReference != 0) { |
return context.typeParameterContext |
- .getTypeParameterType(type.paramReference); |
- } else if (type.syntheticReturnType != null) { |
- // TODO(paulberry): implement. |
- throw new UnimplementedError(); |
- } else if (type.implicitFunctionTypeIndices.isNotEmpty) { |
+ .getTypeParameterType(entity.paramReference); |
+ } else if (entity.syntheticReturnType != null) { |
// TODO(paulberry): implement. |
throw new UnimplementedError(); |
+ } else if (entity.implicitFunctionTypeIndices.isNotEmpty) { |
+ DartType type = resolveRef(entity.reference).asStaticType; |
+ for (int index in entity.implicitFunctionTypeIndices) { |
+ type = (type as FunctionType).parameters[index].type; |
+ } |
+ return type; |
} else { |
+ ReferenceableElementForLink element = resolveRef(entity.reference); |
+ |
DartType getTypeArgument(int i) { |
- if (i < type.typeArguments.length) { |
- return resolveTypeRef(context, type.typeArguments[i]); |
+ if (i < entity.typeArguments.length) { |
+ return resolveTypeRef(context, entity.typeArguments[i]); |
} else if (!instantiateToBoundsAllowed) { |
// Do not allow buildType to instantiate the bounds; force dynamic. |
return DynamicTypeImpl.instance; |
@@ -1109,9 +1114,8 @@ abstract class CompilationUnitElementForLink |
} |
} |
- ReferenceableElementForLink element = resolveRef(type.reference); |
return element.buildType( |
- getTypeArgument, type.implicitFunctionTypeIndices); |
+ getTypeArgument, entity.implicitFunctionTypeIndices); |
} |
} |