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

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 851303002: dart2js: capture type variables in closures, if they are only used in literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 5 years, 11 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/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 46219a33ac29ccc264bde6431b51024c7609aa6c..93e7bb2c2b87e60d99bc6d8ac0dcad80f3a7c8c9 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -731,6 +731,18 @@ class ClosureTranslator extends Visitor {
node.visitChildren(this);
}
+ visitLiteralList(LiteralList node) {
+ DartType type = elements.getType(node);
+ analyzeType(type);
+ node.visitChildren(this);
+ }
+
+ visitLiteralMap(LiteralMap node) {
+ DartType type = elements.getType(node);
+ analyzeType(type);
+ node.visitChildren(this);
+ }
+
void analyzeTypeVariables(DartType type) {
type.forEachTypeVariable((TypeVariableType typeVariable) {
// Field initializers are inlined and access the type variable as
« no previous file with comments | « no previous file | tests/language/type_variable_closure2_test.dart » ('j') | tests/language/type_variable_closure2_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698