Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart |
| index a4e367fa563b7728a987de57d5cf4a04ea97b828..6f07e12c58016fd610c71e9a1185911a389e557f 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart |
| @@ -244,6 +244,13 @@ class PlaceholderCollector extends Visitor { |
| }); |
| } |
| + // TODO(karlklose): should we create placeholders for these? |
| + bool isTypedefParameter(Element element) { |
| + return element != null && |
| + element.enclosingElement != null && |
| + element.enclosingElement.isTypedef(); |
| + } |
| + |
| void tryMakeLocalPlaceholder(Element element, Identifier node) { |
| bool isNamedOptionalParameter() { |
| FunctionElement function = element.enclosingElement; |
| @@ -258,9 +265,10 @@ class PlaceholderCollector extends Visitor { |
| // TODO(smok): Maybe we should rename privates as well, their privacy |
| // should not matter if they are local vars. |
| if (node.source.isPrivate()) return; |
| - if (element.isParameter() && isNamedOptionalParameter()) { |
| + if (element.isParameter() && !isTypedefParameter(element) && |
| + isNamedOptionalParameter()) { |
| currentFunctionScope.registerParameter(node); |
| - } else if (Elements.isLocal(element)) { |
| + } else if (Elements.isLocal(element) && !isTypedefParameter(element)) { |
|
Johnni Winther
2013/09/23 08:06:18
How can this happen?
karlklose
2013/09/23 08:09:52
Typedef parameters are parameters that are not ins
|
| makeLocalPlaceholder(node); |
| } |
| } |