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 91dea96eccfcd4842326578a43b5dfa2282b0880..709b269ebd1b2cfe8511fd996ef89f2c112e5b3f 100644 |
| --- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| +++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart |
| @@ -435,26 +435,29 @@ class PlaceholderCollector extends AbstractVisitor { |
| // We call [resolveReturnType] to allow having 'void'. |
| final type = compiler.resolveReturnType(currentElement, node); |
| if (type is InterfaceType || type is TypedefType) { |
| - var target = node.typeName; |
| + Node target = node.typeName; |
| + bool hasPrefix = false; |
| if (node.typeName is Send) { |
| final element = treeElements[node]; |
| if (element !== null) { |
| final send = node.typeName.asSend(); |
| Identifier receiver = send.receiver; |
| Identifier selector = send.selector; |
| - hasPrefix() { |
| - if (element is TypedefElement) return true; |
| - ClassElement classElement = element; |
| - final constructor = classElement.lookupConstructor( |
| - receiver.source, selector.source); |
| - return constructor === null; |
| - } |
| - if (!hasPrefix()) target = send.receiver; |
| + getConstructor() => |
| + (element as ClassElement).lookupConstructor( |
| + receiver.source, selector.source); |
| + hasPrefix = (element is TypedefElement) || getConstructor() === null; |
| + if (!hasPrefix) target = receiver; |
| } |
| } |
| // TODO(antonm): is there a better way to detect unresolved types? |
| if (type.element !== compiler.types.dynamicType.element) { |
|
Roman
2012/09/24 09:32:53
please add a comment about mycore.Dynamic, mycore.
Anton Muhin
2012/09/24 10:09:37
Done.
|
| - makeTypePlaceholder(target, type); |
| + // Corner case: dart:core type with a prefix. |
| + if (type.element.getLibrary() === coreLibrary && hasPrefix) { |
| + makeNullPlaceholder(node.typeName.receiver); |
| + } else { |
| + makeTypePlaceholder(target, type); |
| + } |
| } else { |
| if (!isDynamicType(node)) makeUnresolvedPlaceholder(target); |
| } |