| 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 | 7 import 'dart:collection' show |
| 8 IterableMixin; | 8 IterableMixin; |
| 9 | 9 |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 } | 864 } |
| 865 | 865 |
| 866 T visitLiteralNull(LiteralNull node) { | 866 T visitLiteralNull(LiteralNull node) { |
| 867 return types.nullType; | 867 return types.nullType; |
| 868 } | 868 } |
| 869 | 869 |
| 870 T visitLiteralSymbol(LiteralSymbol node) { | 870 T visitLiteralSymbol(LiteralSymbol node) { |
| 871 // TODO(kasperl): We should be able to tell that the type of a literal | 871 // TODO(kasperl): We should be able to tell that the type of a literal |
| 872 // symbol is always a non-null exact symbol implementation -- not just | 872 // symbol is always a non-null exact symbol implementation -- not just |
| 873 // any non-null subtype of the symbol interface. | 873 // any non-null subtype of the symbol interface. |
| 874 return types.nonNullSubtype(compiler.symbolClass); | 874 return types.nonNullSubtype(compiler.coreClasses.symbolClass); |
| 875 } | 875 } |
| 876 | 876 |
| 877 @override | 877 @override |
| 878 void previsitDeferredAccess(Send node, PrefixElement prefix, _) { | 878 void previsitDeferredAccess(Send node, PrefixElement prefix, _) { |
| 879 // Deferred access does not affect inference. | 879 // Deferred access does not affect inference. |
| 880 } | 880 } |
| 881 | 881 |
| 882 T handleTypeLiteralGet() { | 882 T handleTypeLiteralGet() { |
| 883 return types.typeType; | 883 return types.typeType; |
| 884 } | 884 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 || (operator == '!=' && !usePositive)) { | 1059 || (operator == '!=' && !usePositive)) { |
| 1060 // Type the elements as null. | 1060 // Type the elements as null. |
| 1061 if (Elements.isLocal(receiverElement)) { | 1061 if (Elements.isLocal(receiverElement)) { |
| 1062 locals.update(receiverElement, types.nullType, node); | 1062 locals.update(receiverElement, types.nullType, node); |
| 1063 } | 1063 } |
| 1064 if (Elements.isLocal(argumentElement)) { | 1064 if (Elements.isLocal(argumentElement)) { |
| 1065 locals.update(argumentElement, types.nullType, node); | 1065 locals.update(argumentElement, types.nullType, node); |
| 1066 } | 1066 } |
| 1067 } else { | 1067 } else { |
| 1068 // Narrow the elements to a non-null type. | 1068 // Narrow the elements to a non-null type. |
| 1069 DartType objectType = compiler.objectClass.rawType; | 1069 DartType objectType = compiler.coreTypes.objectType; |
| 1070 if (Elements.isLocal(receiverElement)) { | 1070 if (Elements.isLocal(receiverElement)) { |
| 1071 narrow(receiverElement, objectType, node); | 1071 narrow(receiverElement, objectType, node); |
| 1072 } | 1072 } |
| 1073 if (Elements.isLocal(argumentElement)) { | 1073 if (Elements.isLocal(argumentElement)) { |
| 1074 narrow(argumentElement, objectType, node); | 1074 narrow(argumentElement, objectType, node); |
| 1075 } | 1075 } |
| 1076 } | 1076 } |
| 1077 } | 1077 } |
| 1078 } | 1078 } |
| 1079 } | 1079 } |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 return type; | 1535 return type; |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 T visitCascade(Cascade node) { | 1538 T visitCascade(Cascade node) { |
| 1539 // Ignore the result of the cascade send and return the type of the cascade | 1539 // Ignore the result of the cascade send and return the type of the cascade |
| 1540 // receiver. | 1540 // receiver. |
| 1541 visit(node.expression); | 1541 visit(node.expression); |
| 1542 return cascadeReceiverStack.removeLast(); | 1542 return cascadeReceiverStack.removeLast(); |
| 1543 } | 1543 } |
| 1544 } | 1544 } |
| OLD | NEW |