Chromium Code Reviews| 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..cc8ac5be1b6b1028e0f55cd1bfe7144c23103ed9 100644 |
| --- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| +++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| @@ -90,13 +90,6 @@ class SendVisitor extends ResolvedVisitor { |
| return; |
| } |
| if (element.isConstructor() || element.isFactoryConstructor()) { |
| - // Rename named constructor in redirection position: |
| - // class C { C.named(); C.redirecting() : this.named(); } |
| - if (node.receiver is Identifier |
| - && node.receiver.asIdentifier().isThis()) { |
| - assert(node.selector is Identifier); |
| - collector.tryMakeMemberPlaceholder(node.selector); |
| - } |
| // Field names can be exposed as names of optional arguments, e.g. |
| // class C { |
| // final field; |
| @@ -473,7 +466,10 @@ class PlaceholderCollector extends Visitor { |
| } |
| } |
| } |
| - node.visitChildren(this); |
| + // Visit only type arguments, otherwise in case of lib.Class type annotation |
| + // typeName is Send and we go to visitGetterSend, as a result "Class" is |
| + // added to member placeholders. |
| + visit(node.typeArguments); |
| } |
| visitVariableDefinitions(VariableDefinitions node) { |
| @@ -530,7 +526,16 @@ class PlaceholderCollector extends Visitor { |
| } |
| } |
| } |
| - node.visitChildren(this); |
| + visit(node.modifiers); |
|
Roman
2012/10/02 14:57:10
I know you don't like calling explicitly visit() f
|
| + // We don't want to visit Send for function name, it appears as |
| + // getter send and we end up renaming constructor as member identifier. |
| + if (node.name is Identifier) { |
| + visitIdentifier(node.name); |
| + } |
| + visit(node.returnType); |
| + visit(node.parameters); |
| + visit(node.initializers); |
| + visit(node.body); |
| // Make sure we don't omit return type of methods which names are |
| // identifiers, because the following works fine: |
| // int interface() => 1; |