Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2925663002: Support for implicitFunctionTypeIndices in CompilationUnitElementForLink.resolveTypeRef(). (Closed)
Patch Set: Remove commented out code. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698