| 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 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 return type; | 1478 return type; |
| 1479 } | 1479 } |
| 1480 | 1480 |
| 1481 if (element == null) { | 1481 if (element == null) { |
| 1482 type = reportFailureAndCreateType( | 1482 type = reportFailureAndCreateType( |
| 1483 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName}); | 1483 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName}); |
| 1484 } else if (element.isAmbiguous()) { | 1484 } else if (element.isAmbiguous()) { |
| 1485 AmbiguousElement ambiguous = element; | 1485 AmbiguousElement ambiguous = element; |
| 1486 type = reportFailureAndCreateType( | 1486 type = reportFailureAndCreateType( |
| 1487 ambiguous.messageKind, ambiguous.messageArguments); | 1487 ambiguous.messageKind, ambiguous.messageArguments); |
| 1488 ambiguous.diagnose(visitor.mapping.currentElement, compiler); |
| 1488 } else if (!element.impliesType()) { | 1489 } else if (!element.impliesType()) { |
| 1489 type = reportFailureAndCreateType( | 1490 type = reportFailureAndCreateType( |
| 1490 MessageKind.NOT_A_TYPE, {'node': node.typeName}); | 1491 MessageKind.NOT_A_TYPE, {'node': node.typeName}); |
| 1491 } else { | 1492 } else { |
| 1492 if (identical(element, compiler.types.voidType.element) || | 1493 if (identical(element, compiler.types.voidType.element) || |
| 1493 identical(element, compiler.types.dynamicType.element)) { | 1494 identical(element, compiler.types.dynamicType.element)) { |
| 1494 type = checkNoTypeArguments(element.computeType(compiler)); | 1495 type = checkNoTypeArguments(element.computeType(compiler)); |
| 1495 } else if (element.isClass()) { | 1496 } else if (element.isClass()) { |
| 1496 ClassElement cls = element; | 1497 ClassElement cls = element; |
| 1497 compiler.resolver._ensureClassWillBeResolved(cls); | 1498 compiler.resolver._ensureClassWillBeResolved(cls); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 if (!inInstanceContext && result.isInstanceMember()) { | 1715 if (!inInstanceContext && result.isInstanceMember()) { |
| 1715 compiler.reportErrorCode( | 1716 compiler.reportErrorCode( |
| 1716 node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': name}); | 1717 node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': name}); |
| 1717 return new ErroneousElementX(MessageKind.NO_INSTANCE_AVAILABLE, | 1718 return new ErroneousElementX(MessageKind.NO_INSTANCE_AVAILABLE, |
| 1718 {'name': name}, | 1719 {'name': name}, |
| 1719 name, enclosingElement); | 1720 name, enclosingElement); |
| 1720 } else if (result.isAmbiguous()) { | 1721 } else if (result.isAmbiguous()) { |
| 1721 AmbiguousElement ambiguous = result; | 1722 AmbiguousElement ambiguous = result; |
| 1722 compiler.reportErrorCode( | 1723 compiler.reportErrorCode( |
| 1723 node, ambiguous.messageKind, ambiguous.messageArguments); | 1724 node, ambiguous.messageKind, ambiguous.messageArguments); |
| 1725 ambiguous.diagnose(enclosingElement, compiler); |
| 1724 return new ErroneousElementX(ambiguous.messageKind, | 1726 return new ErroneousElementX(ambiguous.messageKind, |
| 1725 ambiguous.messageArguments, | 1727 ambiguous.messageArguments, |
| 1726 name, enclosingElement); | 1728 name, enclosingElement); |
| 1727 } | 1729 } |
| 1728 } | 1730 } |
| 1729 return result; | 1731 return result; |
| 1730 } | 1732 } |
| 1731 | 1733 |
| 1732 // Create, or reuse an already created, statement element for a statement. | 1734 // Create, or reuse an already created, statement element for a statement. |
| 1733 TargetElement getOrCreateTargetElement(Node statement) { | 1735 TargetElement getOrCreateTargetElement(Node statement) { |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4020 return e; | 4022 return e; |
| 4021 } | 4023 } |
| 4022 | 4024 |
| 4023 /// Assumed to be called by [resolveRedirectingFactory]. | 4025 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4024 Element visitReturn(Return node) { | 4026 Element visitReturn(Return node) { |
| 4025 Node expression = node.expression; | 4027 Node expression = node.expression; |
| 4026 return finishConstructorReference(visit(expression), | 4028 return finishConstructorReference(visit(expression), |
| 4027 expression, expression); | 4029 expression, expression); |
| 4028 } | 4030 } |
| 4029 } | 4031 } |
| OLD | NEW |