| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 if (baseType.isUnknown()) { | 826 if (baseType.isUnknown()) { |
| 827 return null; | 827 return null; |
| 828 } else if (baseType.isNull()) { | 828 } else if (baseType.isNull()) { |
| 829 return new TypeMask.empty(); | 829 return new TypeMask.empty(); |
| 830 } else { | 830 } else { |
| 831 ClassBaseType classBaseType = baseType; | 831 ClassBaseType classBaseType = baseType; |
| 832 final element = classBaseType.element; | 832 final element = classBaseType.element; |
| 833 if (element != null) { | 833 if (element != null) { |
| 834 if (element == compiler.numClass) { | 834 if (element == compiler.numClass) { |
| 835 return new TypeMask.nonNullSubclass(compiler.numClass.rawType); | 835 return new TypeMask.nonNullSubclass(compiler.numClass.rawType); |
| 836 } else if (element == compiler.dynamicClass) { |
| 837 return new TypeMask.nonNullSubclass(compiler.objectClass.rawType); |
| 836 } else { | 838 } else { |
| 837 return new TypeMask.nonNullExact(element.rawType); | 839 return new TypeMask.nonNullExact(element.rawType); |
| 838 } | 840 } |
| 839 } else { | 841 } else { |
| 840 return null; | 842 return null; |
| 841 } | 843 } |
| 842 } | 844 } |
| 843 } | 845 } |
| 844 | 846 |
| 845 /** | 847 /** |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2057 } | 2059 } |
| 2058 | 2060 |
| 2059 void internalError(String reason, {Node node}) { | 2061 void internalError(String reason, {Node node}) { |
| 2060 inferrer.fail(node, reason); | 2062 inferrer.fail(node, reason); |
| 2061 } | 2063 } |
| 2062 | 2064 |
| 2063 ConcreteType visitTypeReferenceSend(Send) { | 2065 ConcreteType visitTypeReferenceSend(Send) { |
| 2064 return inferrer.singletonConcreteType(inferrer.baseTypes.typeBaseType); | 2066 return inferrer.singletonConcreteType(inferrer.baseTypes.typeBaseType); |
| 2065 } | 2067 } |
| 2066 } | 2068 } |
| OLD | NEW |