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

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

Issue 2814443005: Fix for summarization of generic function type aliases and support for resynthesizing. (Closed)
Patch Set: Created 3 years, 8 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
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index a6620cc6f5b8f6920815ab98cf92b9ebfb2964e1..61955d0494364a4c23d49780ae3adfbb03981cce 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -938,6 +938,9 @@ class _LibraryResynthesizer {
case ReferenceKind.typedef:
return new FunctionTypeAliasElementHandle(
summaryResynthesizer, location);
+ case ReferenceKind.genericFunctionTypedef:
+ return new GenericTypeAliasElementHandle(
+ summaryResynthesizer, location);
case ReferenceKind.topLevelFunction:
return new FunctionElementHandle(summaryResynthesizer, location);
case ReferenceKind.topLevelPropertyAccessor:
@@ -1314,6 +1317,11 @@ class _ReferenceInfo {
}
// Done.
return type;
+ } else if (element is GenericTypeAliasElementHandle) {
+ GenericTypeAliasElementImpl actualElement = element.actualElement;
+ List<DartType> argumentTypes =
+ new List.generate(numTypeArguments, getTypeArgument);
+ return actualElement.typeAfterSubstitution(argumentTypes);
} else if (element is FunctionTypedElement) {
if (element is FunctionTypeAliasElementHandle) {
List<DartType> typeArguments;
@@ -1839,6 +1847,11 @@ class _UnitResynthesizer {
summaryResynthesizer, location);
isDeclarableType = true;
break;
+ case ReferenceKind.genericFunctionTypedef:
+ element = new GenericTypeAliasElementHandle(
+ summaryResynthesizer, location);
+ isDeclarableType = true;
+ break;
case ReferenceKind.variable:
Element enclosingElement = enclosingInfo.element;
if (enclosingElement is ExecutableElement) {
« no previous file with comments | « pkg/analyzer/lib/src/summary/public_namespace_computer.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698