OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library simple_types_inferrer; | 5 library simple_types_inferrer; |
6 | 6 |
7 import '../closure.dart' show ClosureClassMap; | 7 import '../closure.dart' show ClosureClassMap; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/names.dart' show Identifiers, Selectors; | 9 import '../common/names.dart' show Identifiers, Selectors; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 | 236 |
237 TypeInformation visitLiteralNull(ast.LiteralNull node) { | 237 TypeInformation visitLiteralNull(ast.LiteralNull node) { |
238 return types.nullType; | 238 return types.nullType; |
239 } | 239 } |
240 | 240 |
241 TypeInformation visitLiteralSymbol(ast.LiteralSymbol node) { | 241 TypeInformation visitLiteralSymbol(ast.LiteralSymbol node) { |
242 // TODO(kasperl): We should be able to tell that the type of a literal | 242 // TODO(kasperl): We should be able to tell that the type of a literal |
243 // symbol is always a non-null exact symbol implementation -- not just | 243 // symbol is always a non-null exact symbol implementation -- not just |
244 // any non-null subtype of the symbol interface. | 244 // any non-null subtype of the symbol interface. |
245 return types.nonNullSubtype(closedWorld.commonElements.symbolClass); | 245 return types |
| 246 .nonNullSubtype(closedWorld.commonElements.symbolImplementationClass); |
246 } | 247 } |
247 | 248 |
248 @override | 249 @override |
249 void previsitDeferredAccess(ast.Send node, PrefixElement prefix, _) { | 250 void previsitDeferredAccess(ast.Send node, PrefixElement prefix, _) { |
250 // Deferred access does not affect inference. | 251 // Deferred access does not affect inference. |
251 } | 252 } |
252 | 253 |
253 TypeInformation handleTypeLiteralGet() { | 254 TypeInformation handleTypeLiteralGet() { |
254 return types.typeType; | 255 return types.typeType; |
255 } | 256 } |
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2947 Selector moveNextSelector = Selectors.moveNext; | 2948 Selector moveNextSelector = Selectors.moveNext; |
2948 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); | 2949 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); |
2949 | 2950 |
2950 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, | 2951 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, |
2951 iteratorMask, expressionType, new ArgumentsTypes.empty()); | 2952 iteratorMask, expressionType, new ArgumentsTypes.empty()); |
2952 | 2953 |
2953 return handleForInLoop(node, iteratorType, currentSelector, currentMask, | 2954 return handleForInLoop(node, iteratorType, currentSelector, currentMask, |
2954 moveNextSelector, moveNextMask); | 2955 moveNextSelector, moveNextMask); |
2955 } | 2956 } |
2956 } | 2957 } |
OLD | NEW |