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 types; | 5 part of types; |
6 | 6 |
7 class CancelTypeInferenceException { | 7 class CancelTypeInferenceException { |
8 final Node node; | 8 final Node node; |
9 final String reason; | 9 final String reason; |
10 | 10 |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 } | 1129 } |
1130 return type; | 1130 return type; |
1131 } | 1131 } |
1132 | 1132 |
1133 ConcreteType visitOperator(Operator node) { | 1133 ConcreteType visitOperator(Operator node) { |
1134 inferrer.fail(node, 'not yet implemented'); | 1134 inferrer.fail(node, 'not yet implemented'); |
1135 } | 1135 } |
1136 | 1136 |
1137 ConcreteType visitReturn(Return node) { | 1137 ConcreteType visitReturn(Return node) { |
1138 final expression = node.expression; | 1138 final expression = node.expression; |
1139 return (expression === null) | 1139 return (expression == null) |
1140 ? new ConcreteType.singleton(const NullBaseType()) | 1140 ? new ConcreteType.singleton(const NullBaseType()) |
1141 : analyze(expression); | 1141 : analyze(expression); |
1142 } | 1142 } |
1143 | 1143 |
1144 ConcreteType visitThrow(Throw node) { | 1144 ConcreteType visitThrow(Throw node) { |
1145 if (node.expression != null) analyze(node.expression); | 1145 if (node.expression != null) analyze(node.expression); |
1146 return new ConcreteType.empty(); | 1146 return new ConcreteType.empty(); |
1147 } | 1147 } |
1148 | 1148 |
1149 ConcreteType visitTypeAnnotation(TypeAnnotation node) { | 1149 ConcreteType visitTypeAnnotation(TypeAnnotation node) { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 } | 1449 } |
1450 | 1450 |
1451 void internalError(String reason, {Node node}) { | 1451 void internalError(String reason, {Node node}) { |
1452 inferrer.fail(node, reason); | 1452 inferrer.fail(node, reason); |
1453 } | 1453 } |
1454 | 1454 |
1455 ConcreteType visitTypeReferenceSend(Send) { | 1455 ConcreteType visitTypeReferenceSend(Send) { |
1456 return new ConcreteType.singleton(inferrer.baseTypes.typeBaseType); | 1456 return new ConcreteType.singleton(inferrer.baseTypes.typeBaseType); |
1457 } | 1457 } |
1458 } | 1458 } |
OLD | NEW |