| 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 inferrer_visitor; | 5 library inferrer_visitor; |
| 6 | 6 |
| 7 import 'dart:collection' show IterableMixin; | 7 import 'dart:collection' show IterableMixin; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../options.dart' show CompilerOptions; | 10 import '../options.dart' show CompilerOptions; |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 } | 884 } |
| 885 | 885 |
| 886 T visitLiteralNull(LiteralNull node) { | 886 T visitLiteralNull(LiteralNull node) { |
| 887 return types.nullType; | 887 return types.nullType; |
| 888 } | 888 } |
| 889 | 889 |
| 890 T visitLiteralSymbol(LiteralSymbol node) { | 890 T visitLiteralSymbol(LiteralSymbol node) { |
| 891 // TODO(kasperl): We should be able to tell that the type of a literal | 891 // TODO(kasperl): We should be able to tell that the type of a literal |
| 892 // symbol is always a non-null exact symbol implementation -- not just | 892 // symbol is always a non-null exact symbol implementation -- not just |
| 893 // any non-null subtype of the symbol interface. | 893 // any non-null subtype of the symbol interface. |
| 894 return types.nonNullSubtype(closedWorld.coreClasses.symbolClass); | 894 return types.nonNullSubtype(closedWorld.commonElements.symbolClass); |
| 895 } | 895 } |
| 896 | 896 |
| 897 @override | 897 @override |
| 898 void previsitDeferredAccess(Send node, PrefixElement prefix, _) { | 898 void previsitDeferredAccess(Send node, PrefixElement prefix, _) { |
| 899 // Deferred access does not affect inference. | 899 // Deferred access does not affect inference. |
| 900 } | 900 } |
| 901 | 901 |
| 902 T handleTypeLiteralGet() { | 902 T handleTypeLiteralGet() { |
| 903 return types.typeType; | 903 return types.typeType; |
| 904 } | 904 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 (operator == '!=' && !usePositive)) { | 1035 (operator == '!=' && !usePositive)) { |
| 1036 // Type the elements as null. | 1036 // Type the elements as null. |
| 1037 if (Elements.isLocal(receiverElement)) { | 1037 if (Elements.isLocal(receiverElement)) { |
| 1038 locals.update(receiverElement, types.nullType, node); | 1038 locals.update(receiverElement, types.nullType, node); |
| 1039 } | 1039 } |
| 1040 if (Elements.isLocal(argumentElement)) { | 1040 if (Elements.isLocal(argumentElement)) { |
| 1041 locals.update(argumentElement, types.nullType, node); | 1041 locals.update(argumentElement, types.nullType, node); |
| 1042 } | 1042 } |
| 1043 } else { | 1043 } else { |
| 1044 // Narrow the elements to a non-null type. | 1044 // Narrow the elements to a non-null type. |
| 1045 DartType objectType = closedWorld.coreTypes.objectType; | 1045 DartType objectType = closedWorld.commonElements.objectType; |
| 1046 if (Elements.isLocal(receiverElement)) { | 1046 if (Elements.isLocal(receiverElement)) { |
| 1047 narrow(receiverElement, objectType, node); | 1047 narrow(receiverElement, objectType, node); |
| 1048 } | 1048 } |
| 1049 if (Elements.isLocal(argumentElement)) { | 1049 if (Elements.isLocal(argumentElement)) { |
| 1050 narrow(argumentElement, objectType, node); | 1050 narrow(argumentElement, objectType, node); |
| 1051 } | 1051 } |
| 1052 } | 1052 } |
| 1053 } | 1053 } |
| 1054 } | 1054 } |
| 1055 } | 1055 } |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 return type; | 1495 return type; |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 T visitCascade(Cascade node) { | 1498 T visitCascade(Cascade node) { |
| 1499 // Ignore the result of the cascade send and return the type of the cascade | 1499 // Ignore the result of the cascade send and return the type of the cascade |
| 1500 // receiver. | 1500 // receiver. |
| 1501 visit(node.expression); | 1501 visit(node.expression); |
| 1502 return cascadeReceiverStack.removeLast(); | 1502 return cascadeReceiverStack.removeLast(); |
| 1503 } | 1503 } |
| 1504 } | 1504 } |
| OLD | NEW |