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

Unified Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 11034021: [dart2dart] Don't go inside TypeAnnotation.typeName, otherwise in "new lib.A()" expression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 18d0b3963f8c344516f09962384608812021099f..5fd336874bdd8ea4b70fe9999b79af10441e4074 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -434,9 +434,9 @@ class PlaceholderCollector extends Visitor {
}
// We call [resolveReturnType] to allow having 'void'.
final type = compiler.resolveReturnType(currentElement, node);
+ bool hasPrefix = false;
if (type is InterfaceType || type is TypedefType) {
Node target = node.typeName;
- bool hasPrefix = false;
if (node.typeName is Send) {
final send = node.typeName.asSend();
Identifier receiver = send.receiver;
@@ -473,7 +473,16 @@ class PlaceholderCollector extends Visitor {
}
}
}
- node.visitChildren(this);
+ // Trying to differentiate new A.foo() and lib.A cases. In the latter case
+ // we don't want to go deeper into typeName.
+ if (hasPrefix) {
+ // Visit only type arguments, otherwise in case of lib.Class type annotation
Anton Muhin 2012/10/04 12:26:47 nit: long line
Roman 2012/10/04 12:40:48 Done.
+ // typeName is Send and we go to visitGetterSend, as a result "Class" is
+ // added to member placeholders.
+ visit(node.typeArguments);
+ } else {
+ node.visitChildren(this);
+ }
}
visitVariableDefinitions(VariableDefinitions node) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698