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

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

Issue 2989563002: Preserve type variables in closure conversion. (Closed)
Patch Set: Visit more children, review comments. Created 3 years, 5 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 | « pkg/kernel/binary.md ('k') | pkg/kernel/lib/binary/ast_from_binary.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 5c432803f549d673c68e4be3251a29179143b1d6..722da644f18587a22a89b504c2a7f050dc05a170 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -3076,14 +3076,15 @@ class ClosureCreation extends Expression {
Reference topLevelFunctionReference;
Expression contextVector;
FunctionType functionType;
+ List<DartType> typeArguments;
ClosureCreation(Member topLevelFunction, Expression contextVector,
- FunctionType functionType)
- : this.byReference(
- getMemberReference(topLevelFunction), contextVector, functionType);
+ FunctionType functionType, List<DartType> typeArguments)
+ : this.byReference(getMemberReference(topLevelFunction), contextVector,
+ functionType, typeArguments);
- ClosureCreation.byReference(
- this.topLevelFunctionReference, this.contextVector, this.functionType) {
+ ClosureCreation.byReference(this.topLevelFunctionReference,
+ this.contextVector, this.functionType, this.typeArguments) {
contextVector?.parent = this;
}
@@ -3098,6 +3099,8 @@ class ClosureCreation extends Expression {
visitChildren(Visitor v) {
contextVector?.accept(v);
+ functionType.accept(v);
+ visitList(typeArguments, v);
}
transformChildren(Transformer v) {
@@ -3105,6 +3108,8 @@ class ClosureCreation extends Expression {
contextVector = contextVector.accept(v);
contextVector?.parent = this;
}
+ functionType = v.visitDartType(functionType);
+ transformTypeList(typeArguments, v);
}
DartType getStaticType(TypeEnvironment types) {
« no previous file with comments | « pkg/kernel/binary.md ('k') | pkg/kernel/lib/binary/ast_from_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698