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

Unified Diff: pkg/kernel/lib/ast.dart

Issue 2993993002: Implement erasure of local function declarations. (Closed)
Patch Set: Fix typo and merge with master. Created 3 years, 4 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/kernel/lib/transformations/erasure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/ast.dart
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index 0b019870c0367e71da86079c4984453241bdc2e6..f0d508fa304f7a54799b98ecc72f1f45b07abceb 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -1536,13 +1536,16 @@ class FunctionNode extends TreeNode {
List<NamedType> named =
namedParameters.map(_getNamedTypeOfVariable).toList(growable: false);
named.sort();
+ // We need create a copy of the list of type parameters, otherwise
+ // transformations like erasure don't work.
+ var typeParametersCopy = new List<TypeParameter>.from(parent is Constructor
+ ? parent.enclosingClass.typeParameters
+ : typeParameters);
return new FunctionType(
positionalParameters.map(_getTypeOfVariable).toList(growable: false),
returnType,
namedParameters: named,
- typeParameters: parent is Constructor
- ? parent.enclosingClass.typeParameters
- : typeParameters,
+ typeParameters: typeParametersCopy,
requiredParameterCount: requiredParameterCount);
}
« no previous file with comments | « no previous file | pkg/kernel/lib/transformations/erasure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698