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 /// Implementation of the Dart types hierarchy in 'types.dart' specifically | 5 /// Implementation of the Dart types hierarchy in 'types.dart' specifically |
6 /// tailored to the resolution phase of the compiler. | 6 /// tailored to the resolution phase of the compiler. |
7 | 7 |
8 library resolution_types; | 8 library resolution_types; |
9 | 9 |
10 import 'dart:math' show min; | 10 import 'dart:math' show min; |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 cls.supertype; | 1131 cls.supertype; |
1132 | 1132 |
1133 @override | 1133 @override |
1134 Iterable<InterfaceType> getSupertypes(covariant ClassElement cls) { | 1134 Iterable<InterfaceType> getSupertypes(covariant ClassElement cls) { |
1135 assert(cls.allSupertypes != null, | 1135 assert(cls.allSupertypes != null, |
1136 failedAt(cls, 'Supertypes have not been computed for $cls.')); | 1136 failedAt(cls, 'Supertypes have not been computed for $cls.')); |
1137 return cls.allSupertypes; | 1137 return cls.allSupertypes; |
1138 } | 1138 } |
1139 | 1139 |
1140 @override | 1140 @override |
| 1141 Iterable<InterfaceType> getInterfaces(covariant ClassElement cls) { |
| 1142 return new List<InterfaceType>.from(cls.interfaces.toList()); |
| 1143 } |
| 1144 |
| 1145 @override |
1141 FunctionType getCallType(covariant ResolutionInterfaceType type) => | 1146 FunctionType getCallType(covariant ResolutionInterfaceType type) => |
1142 type.callType; | 1147 type.callType; |
1143 | 1148 |
1144 /// Flatten [type] by recursively removing enclosing `Future` annotations. | 1149 /// Flatten [type] by recursively removing enclosing `Future` annotations. |
1145 /// | 1150 /// |
1146 /// Defined in the language specification as: | 1151 /// Defined in the language specification as: |
1147 /// | 1152 /// |
1148 /// If T = Future<S> then flatten(T) = flatten(S). | 1153 /// If T = Future<S> then flatten(T) = flatten(S). |
1149 /// Otherwise if T <: Future then let S be a type such that T << Future<S> | 1154 /// Otherwise if T <: Future then let S be a type such that T << Future<S> |
1150 /// and for all R, if T << Future<R> then S << R. Then flatten(T) = S. | 1155 /// and for all R, if T << Future<R> then S << R. Then flatten(T) = S. |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 sb.write(', '); | 1835 sb.write(', '); |
1831 } | 1836 } |
1832 namedParameterTypes[index].accept(this, namedParameters[index]); | 1837 namedParameterTypes[index].accept(this, namedParameters[index]); |
1833 needsComma = true; | 1838 needsComma = true; |
1834 } | 1839 } |
1835 sb.write('}'); | 1840 sb.write('}'); |
1836 } | 1841 } |
1837 sb.write(')'); | 1842 sb.write(')'); |
1838 } | 1843 } |
1839 } | 1844 } |
OLD | NEW |