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 21d08ced41747468a001ae963d6ed3cc23a257c1..479462ab283ef17358276fa2e618ffcaa814edd5 100644 |
| --- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| +++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| @@ -499,6 +499,9 @@ class PlaceholderCollector extends AbstractVisitor { |
| } |
| visitFunctionExpression(FunctionExpression node) { |
| + bool isKeyword(Identifier id) => |
| + id !== null && Keyword.keywords[id.source.slowToString()] !== null; |
| + |
| Element element = treeElements[node]; |
| // May get null here in case of A(int this.f()); |
| if (element !== null) { |
| @@ -514,7 +517,13 @@ class PlaceholderCollector extends AbstractVisitor { |
| } |
| } |
| node.visitChildren(this); |
| - makeOmitDeclarationTypePlaceholder(node.returnType); |
| + // Make sure we don't omit return type of methods which names are |
|
Anton Muhin
2012/09/19 06:51:37
TODO to change that and bug against VM?
Roman
2012/09/19 09:17:36
http://code.google.com/p/dart/issues/detail?id=527
|
| + // identifiers, because the following works fine: |
| + // int interface() => 1; |
| + // But omitting 'int' makes VM unhappy. |
| + if (node.name === null || !isKeyword(node.name.asIdentifier())) { |
| + makeOmitDeclarationTypePlaceholder(node.returnType); |
| + } |
| collectFunctionParameters(node.parameters); |
| } |