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 4456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4467 Identifier name = node.selector.asIdentifier(); | 4467 Identifier name = node.selector.asIdentifier(); |
4468 if (name == null) internalError(node.selector, 'unexpected node'); | 4468 if (name == null) internalError(node.selector, 'unexpected node'); |
4469 | 4469 |
4470 if (identical(e.kind, ElementKind.CLASS)) { | 4470 if (identical(e.kind, ElementKind.CLASS)) { |
4471 ClassElement cls = e; | 4471 ClassElement cls = e; |
4472 cls.ensureResolved(compiler); | 4472 cls.ensureResolved(compiler); |
4473 return lookupConstructor(cls, name, name.source); | 4473 return lookupConstructor(cls, name, name.source); |
4474 } else if (identical(e.kind, ElementKind.PREFIX)) { | 4474 } else if (identical(e.kind, ElementKind.PREFIX)) { |
4475 PrefixElement prefix = e; | 4475 PrefixElement prefix = e; |
4476 e = prefix.lookupLocalMember(name.source); | 4476 e = prefix.lookupLocalMember(name.source); |
| 4477 e = Elements.unwrap(e, compiler, node); |
4477 if (e == null) { | 4478 if (e == null) { |
4478 return failOrReturnErroneousElement( | 4479 return failOrReturnErroneousElement( |
4479 resolver.enclosingElement, name, | 4480 resolver.enclosingElement, name, |
4480 name.source, | 4481 name.source, |
4481 MessageKind.CANNOT_RESOLVE, | 4482 MessageKind.CANNOT_RESOLVE, |
4482 {'name': name}); | 4483 {'name': name}); |
4483 } else if (!identical(e.kind, ElementKind.CLASS)) { | 4484 } else if (!identical(e.kind, ElementKind.CLASS)) { |
4484 error(node, MessageKind.NOT_A_TYPE.error, {'node': name}); | 4485 error(node, MessageKind.NOT_A_TYPE.error, {'node': name}); |
4485 } | 4486 } |
4486 } else { | 4487 } else { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4519 return finishConstructorReference(visit(expression), | 4520 return finishConstructorReference(visit(expression), |
4520 expression, expression); | 4521 expression, expression); |
4521 } | 4522 } |
4522 } | 4523 } |
4523 | 4524 |
4524 /// Looks up [name] in [scope] and unwraps the result. | 4525 /// Looks up [name] in [scope] and unwraps the result. |
4525 Element lookupInScope(Compiler compiler, Node node, | 4526 Element lookupInScope(Compiler compiler, Node node, |
4526 Scope scope, SourceString name) { | 4527 Scope scope, SourceString name) { |
4527 return Elements.unwrap(scope.lookup(name), compiler, node); | 4528 return Elements.unwrap(scope.lookup(name), compiler, node); |
4528 } | 4529 } |
OLD | NEW |