OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of resolution; | 5 part of resolution; |
6 | 6 |
7 abstract class TreeElements { | 7 abstract class TreeElements { |
8 Element get currentElement; | 8 Element get currentElement; |
9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
10 | 10 |
(...skipping 4457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4468 Identifier name = node.selector.asIdentifier(); | 4468 Identifier name = node.selector.asIdentifier(); |
4469 if (name == null) internalError(node.selector, 'unexpected node'); | 4469 if (name == null) internalError(node.selector, 'unexpected node'); |
4470 | 4470 |
4471 if (identical(e.kind, ElementKind.CLASS)) { | 4471 if (identical(e.kind, ElementKind.CLASS)) { |
4472 ClassElement cls = e; | 4472 ClassElement cls = e; |
4473 cls.ensureResolved(compiler); | 4473 cls.ensureResolved(compiler); |
4474 return lookupConstructor(cls, name, name.source); | 4474 return lookupConstructor(cls, name, name.source); |
4475 } else if (identical(e.kind, ElementKind.PREFIX)) { | 4475 } else if (identical(e.kind, ElementKind.PREFIX)) { |
4476 PrefixElement prefix = e; | 4476 PrefixElement prefix = e; |
4477 e = prefix.lookupLocalMember(name.source); | 4477 e = prefix.lookupLocalMember(name.source); |
| 4478 e = Elements.unwrap(e, compiler, node); |
4478 if (e == null) { | 4479 if (e == null) { |
4479 return failOrReturnErroneousElement( | 4480 return failOrReturnErroneousElement( |
4480 resolver.enclosingElement, name, | 4481 resolver.enclosingElement, name, |
4481 name.source, | 4482 name.source, |
4482 MessageKind.CANNOT_RESOLVE, | 4483 MessageKind.CANNOT_RESOLVE, |
4483 {'name': name}); | 4484 {'name': name}); |
4484 } else if (!identical(e.kind, ElementKind.CLASS)) { | 4485 } else if (!identical(e.kind, ElementKind.CLASS)) { |
4485 error(node, MessageKind.NOT_A_TYPE.error, {'node': name}); | 4486 error(node, MessageKind.NOT_A_TYPE.error, {'node': name}); |
4486 } | 4487 } |
4487 } else { | 4488 } else { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4520 return finishConstructorReference(visit(expression), | 4521 return finishConstructorReference(visit(expression), |
4521 expression, expression); | 4522 expression, expression); |
4522 } | 4523 } |
4523 } | 4524 } |
4524 | 4525 |
4525 /// Looks up [name] in [scope] and unwraps the result. | 4526 /// Looks up [name] in [scope] and unwraps the result. |
4526 Element lookupInScope(Compiler compiler, Node node, | 4527 Element lookupInScope(Compiler compiler, Node node, |
4527 Scope scope, SourceString name) { | 4528 Scope scope, SourceString name) { |
4528 return Elements.unwrap(scope.lookup(name), compiler, node); | 4529 return Elements.unwrap(scope.lookup(name), compiler, node); |
4529 } | 4530 } |
OLD | NEW |