| 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 4001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4012 Node expression) { | 4012 Node expression) { |
| 4013 // Find the unnamed constructor if the reference resolved to a | 4013 // Find the unnamed constructor if the reference resolved to a |
| 4014 // class. | 4014 // class. |
| 4015 if (!Elements.isUnresolved(e) && !e.isConstructor()) { | 4015 if (!Elements.isUnresolved(e) && !e.isConstructor()) { |
| 4016 if (e.isClass()) { | 4016 if (e.isClass()) { |
| 4017 ClassElement cls = e; | 4017 ClassElement cls = e; |
| 4018 cls.ensureResolved(compiler); | 4018 cls.ensureResolved(compiler); |
| 4019 // The unnamed constructor may not exist, so [e] may become unresolved. | 4019 // The unnamed constructor may not exist, so [e] may become unresolved. |
| 4020 e = lookupConstructor(cls, diagnosticNode, const SourceString('')); | 4020 e = lookupConstructor(cls, diagnosticNode, const SourceString('')); |
| 4021 } else { | 4021 } else { |
| 4022 error(diagnosticNode, | 4022 e = failOrReturnErroneousElement( |
| 4023 MessageKind.NOT_A_TYPE.error, | 4023 e, diagnosticNode, e.name, MessageKind.NOT_A_TYPE, |
| 4024 {'node': diagnosticNode}); | 4024 {'node': diagnosticNode}); |
| 4025 } | 4025 } |
| 4026 } | 4026 } |
| 4027 if (type == null) { | 4027 if (type == null) { |
| 4028 if (Elements.isUnresolved(e)) { | 4028 if (Elements.isUnresolved(e)) { |
| 4029 type = compiler.types.dynamicType; | 4029 type = compiler.types.dynamicType; |
| 4030 } else { | 4030 } else { |
| 4031 type = e.getEnclosingClass().computeType(compiler).asRaw(); | 4031 type = e.getEnclosingClass().computeType(compiler).asRaw(); |
| 4032 } | 4032 } |
| 4033 } | 4033 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4093 return e; | 4093 return e; |
| 4094 } | 4094 } |
| 4095 | 4095 |
| 4096 /// Assumed to be called by [resolveRedirectingFactory]. | 4096 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4097 Element visitReturn(Return node) { | 4097 Element visitReturn(Return node) { |
| 4098 Node expression = node.expression; | 4098 Node expression = node.expression; |
| 4099 return finishConstructorReference(visit(expression), | 4099 return finishConstructorReference(visit(expression), |
| 4100 expression, expression); | 4100 expression, expression); |
| 4101 } | 4101 } |
| 4102 } | 4102 } |
| OLD | NEW |