| 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 operator[](Node node); | 8 Element operator[](Node node); |
| 9 Selector getSelector(Send send); | 9 Selector getSelector(Send send); |
| 10 Selector getGetterSelectorInComplexSendSet(SendSet node); | 10 Selector getGetterSelectorInComplexSendSet(SendSet node); |
| (...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 } | 2584 } |
| 2585 return type; | 2585 return type; |
| 2586 } | 2586 } |
| 2587 | 2587 |
| 2588 visitModifiers(Modifiers node) { | 2588 visitModifiers(Modifiers node) { |
| 2589 // TODO(ngeoffray): Implement this. | 2589 // TODO(ngeoffray): Implement this. |
| 2590 unimplemented(node, 'modifiers'); | 2590 unimplemented(node, 'modifiers'); |
| 2591 } | 2591 } |
| 2592 | 2592 |
| 2593 visitLiteralList(LiteralList node) { | 2593 visitLiteralList(LiteralList node) { |
| 2594 world.registerInstantiatedClass(compiler.listClass); | |
| 2595 NodeList arguments = node.typeArguments; | 2594 NodeList arguments = node.typeArguments; |
| 2595 DartType typeArgument; |
| 2596 if (arguments != null) { | 2596 if (arguments != null) { |
| 2597 Link<Node> nodes = arguments.nodes; | 2597 Link<Node> nodes = arguments.nodes; |
| 2598 if (nodes.isEmpty) { | 2598 if (nodes.isEmpty) { |
| 2599 error(arguments, MessageKind.MISSING_TYPE_ARGUMENT); | 2599 error(arguments, MessageKind.MISSING_TYPE_ARGUMENT); |
| 2600 } else { | 2600 } else { |
| 2601 resolveTypeRequired(nodes.head); | 2601 typeArgument = resolveTypeRequired(nodes.head); |
| 2602 for (nodes = nodes.tail; !nodes.isEmpty; nodes = nodes.tail) { | 2602 for (nodes = nodes.tail; !nodes.isEmpty; nodes = nodes.tail) { |
| 2603 error(nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT); | 2603 error(nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT); |
| 2604 resolveTypeRequired(nodes.head); | 2604 resolveTypeRequired(nodes.head); |
| 2605 } | 2605 } |
| 2606 } | 2606 } |
| 2607 } | 2607 } |
| 2608 DartType listType; |
| 2609 if (typeArgument != null) { |
| 2610 listType = new InterfaceType(compiler.listClass, |
| 2611 new Link<DartType>.fromList([typeArgument])); |
| 2612 } else { |
| 2613 listType = compiler.listClass.rawType; |
| 2614 } |
| 2615 world.registerInstantiatedType(listType); |
| 2608 visit(node.elements); | 2616 visit(node.elements); |
| 2609 } | 2617 } |
| 2610 | 2618 |
| 2611 visitConditional(Conditional node) { | 2619 visitConditional(Conditional node) { |
| 2612 node.visitChildren(this); | 2620 node.visitChildren(this); |
| 2613 } | 2621 } |
| 2614 | 2622 |
| 2615 visitStringInterpolation(StringInterpolation node) { | 2623 visitStringInterpolation(StringInterpolation node) { |
| 2616 world.registerInstantiatedClass(compiler.stringClass); | 2624 world.registerInstantiatedClass(compiler.stringClass); |
| 2617 compiler.backend.registerStringInterpolation(); | 2625 compiler.backend.registerStringInterpolation(); |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3808 return e; | 3816 return e; |
| 3809 } | 3817 } |
| 3810 | 3818 |
| 3811 /// Assumed to be called by [resolveRedirectingFactory]. | 3819 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3812 Element visitReturn(Return node) { | 3820 Element visitReturn(Return node) { |
| 3813 Node expression = node.expression; | 3821 Node expression = node.expression; |
| 3814 return finishConstructorReference(visit(expression), | 3822 return finishConstructorReference(visit(expression), |
| 3815 expression, expression); | 3823 expression, expression); |
| 3816 } | 3824 } |
| 3817 } | 3825 } |
| OLD | NEW |