| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // TODO(sigmund): rename and move to common/elements.dart | 5 // TODO(sigmund): rename and move to common/elements.dart |
| 6 library dart2js.type_system; | 6 library dart2js.type_system; |
| 7 | 7 |
| 8 import 'common/names.dart' show Uris; | 8 import 'common/names.dart' show Uris; |
| 9 import 'elements/types.dart'; | 9 import 'elements/types.dart'; |
| 10 import 'elements/entities.dart'; | 10 import 'elements/entities.dart'; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 DartType get dynamicType; | 278 DartType get dynamicType; |
| 279 | 279 |
| 280 /// Returns the 'raw type' of [cls]. That is, the instantiation of [cls] | 280 /// Returns the 'raw type' of [cls]. That is, the instantiation of [cls] |
| 281 /// where all types arguments are `dynamic`. | 281 /// where all types arguments are `dynamic`. |
| 282 InterfaceType getRawType(ClassEntity cls); | 282 InterfaceType getRawType(ClassEntity cls); |
| 283 | 283 |
| 284 /// Returns the 'this type' of [cls]. That is, the instantiation of [cls] | 284 /// Returns the 'this type' of [cls]. That is, the instantiation of [cls] |
| 285 /// where the type arguments are the type variables of [cls]. | 285 /// where the type arguments are the type variables of [cls]. |
| 286 InterfaceType getThisType(ClassEntity cls); | 286 InterfaceType getThisType(ClassEntity cls); |
| 287 | 287 |
| 288 /// The upper bound on the [typeVariable]. If not explicitly declared, this is |
| 289 /// `Object`. |
| 290 DartType getTypeVariableBound(TypeVariableEntity typeVariable); |
| 291 |
| 288 /// Returns `true` if [a] is a subtype of [b]. | 292 /// Returns `true` if [a] is a subtype of [b]. |
| 289 bool isSubtype(DartType a, DartType b); | 293 bool isSubtype(DartType a, DartType b); |
| 290 | 294 |
| 291 /// Returns the type if [function]. | 295 /// Returns the type if [function]. |
| 292 FunctionType getFunctionType(FunctionEntity function); | 296 FunctionType getFunctionType(FunctionEntity function); |
| 293 | 297 |
| 294 /// Returns the [CallStructure] corresponding to calling [entity] with all | 298 /// Returns the [CallStructure] corresponding to calling [entity] with all |
| 295 /// arguments, both required and optional. | 299 /// arguments, both required and optional. |
| 296 CallStructure getCallStructure(FunctionEntity entity); | 300 CallStructure getCallStructure(FunctionEntity entity); |
| 297 | 301 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 } | 572 } |
| 569 | 573 |
| 570 @override | 574 @override |
| 571 InterfaceType streamType([DartType elementType]) { | 575 InterfaceType streamType([DartType elementType]) { |
| 572 if (elementType == null) { | 576 if (elementType == null) { |
| 573 return getRawType(streamClass); | 577 return getRawType(streamClass); |
| 574 } | 578 } |
| 575 return createInterfaceType(streamClass, [elementType]); | 579 return createInterfaceType(streamClass, [elementType]); |
| 576 } | 580 } |
| 577 } | 581 } |
| OLD | NEW |