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 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2194 target = | 2194 target = |
2195 warnAndCreateErroneousElement(node.selector, field.name, | 2195 warnAndCreateErroneousElement(node.selector, field.name, |
2196 MessageKind.CANNOT_RESOLVE_GETTER); | 2196 MessageKind.CANNOT_RESOLVE_GETTER); |
2197 } | 2197 } |
2198 } else if (target.isTypeVariable()) { | 2198 } else if (target.isTypeVariable()) { |
2199 ClassElement cls = target.getEnclosingClass(); | 2199 ClassElement cls = target.getEnclosingClass(); |
2200 assert(enclosingElement.getEnclosingClass() == cls); | 2200 assert(enclosingElement.getEnclosingClass() == cls); |
2201 compiler.backend.registerClassUsingVariableExpression(cls); | 2201 compiler.backend.registerClassUsingVariableExpression(cls); |
2202 compiler.backend.registerTypeVariableExpression(mapping); | 2202 compiler.backend.registerTypeVariableExpression(mapping); |
2203 } else if (target.impliesType() && !sendIsMemberAccess) { | 2203 } else if (target.impliesType() && !sendIsMemberAccess) { |
2204 // Set the type of the node to [Type] to mark this send as a | |
2205 // type literal. | |
2206 mapping.setType(node, compiler.typeClass.computeType(compiler)); | |
2207 compiler.backend.registerTypeLiteral(mapping); | 2204 compiler.backend.registerTypeLiteral(mapping); |
2208 } | 2205 } |
2209 } | 2206 } |
2210 | 2207 |
2211 bool resolvedArguments = false; | 2208 bool resolvedArguments = false; |
2212 if (node.isOperator) { | 2209 if (node.isOperator) { |
2213 String operatorString = node.selector.asOperator().source.stringValue; | 2210 String operatorString = node.selector.asOperator().source.stringValue; |
2214 if (operatorString == 'is') { | 2211 if (operatorString == 'is') { |
2215 DartType type = resolveTypeRequired(node.typeAnnotationFromIsCheck); | 2212 DartType type = resolveTypeRequired(node.typeAnnotationFromIsCheck); |
2216 if (type != null) { | 2213 if (type != null) { |
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3926 return e; | 3923 return e; |
3927 } | 3924 } |
3928 | 3925 |
3929 /// Assumed to be called by [resolveRedirectingFactory]. | 3926 /// Assumed to be called by [resolveRedirectingFactory]. |
3930 Element visitReturn(Return node) { | 3927 Element visitReturn(Return node) { |
3931 Node expression = node.expression; | 3928 Node expression = node.expression; |
3932 return finishConstructorReference(visit(expression), | 3929 return finishConstructorReference(visit(expression), |
3933 expression, expression); | 3930 expression, expression); |
3934 } | 3931 } |
3935 } | 3932 } |
OLD | NEW |