| 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.dart'; | 8 import 'common.dart'; |
| 9 import 'elements/types.dart'; | 9 import 'elements/types.dart'; |
| 10 import 'elements/entities.dart'; | 10 import 'elements/entities.dart'; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 /// Lookup the member [name] in [cls], fail if the class is missing and | 234 /// Lookup the member [name] in [cls], fail if the class is missing and |
| 235 /// [required]. | 235 /// [required]. |
| 236 MemberEntity lookupClassMember(ClassEntity cls, String name, | 236 MemberEntity lookupClassMember(ClassEntity cls, String name, |
| 237 {bool setter: false, bool required: false}); | 237 {bool setter: false, bool required: false}); |
| 238 | 238 |
| 239 /// Lookup the constructor [name] in [cls], fail if the class is missing and | 239 /// Lookup the constructor [name] in [cls], fail if the class is missing and |
| 240 /// [required]. | 240 /// [required]. |
| 241 ConstructorEntity lookupConstructor(ClassEntity cls, String name, | 241 ConstructorEntity lookupConstructor(ClassEntity cls, String name, |
| 242 {bool required: false}); | 242 {bool required: false}); |
| 243 | 243 |
| 244 /// Calls [f] for each class member declared or inherited in [cls] together |
| 245 /// with the class that declared the member. |
| 246 /// |
| 247 /// TODO(johnniwinther): This should not include static members of |
| 248 /// superclasses. |
| 249 void forEachClassMember( |
| 250 ClassEntity cls, void f(ClassEntity declarer, MemberEntity member)); |
| 251 |
| 252 /// Calls [f] for each class that is mixed into [cls] or one of its |
| 253 /// superclasses. |
| 254 void forEachMixin(ClassEntity cls, void f(ClassEntity mixin)); |
| 255 |
| 244 /// Create the instantiation of [cls] with the given [typeArguments]. | 256 /// Create the instantiation of [cls] with the given [typeArguments]. |
| 245 InterfaceType createInterfaceType( | 257 InterfaceType createInterfaceType( |
| 246 ClassEntity cls, List<DartType> typeArguments); | 258 ClassEntity cls, List<DartType> typeArguments); |
| 247 | 259 |
| 248 /// Returns the 'raw type' of [cls]. That is, the instantiation of [cls] | 260 /// Returns the 'raw type' of [cls]. That is, the instantiation of [cls] |
| 249 /// where all types arguments are `dynamic`. | 261 /// where all types arguments are `dynamic`. |
| 250 InterfaceType getRawType(ClassEntity cls); | 262 InterfaceType getRawType(ClassEntity cls); |
| 251 | 263 |
| 252 /// Returns the 'this type' of [cls]. That is, the instantiation of [cls] | 264 /// Returns the 'this type' of [cls]. That is, the instantiation of [cls] |
| 253 /// where the type arguments are the type variables of [cls]. | 265 /// where the type arguments are the type variables of [cls]. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } | 512 } |
| 501 | 513 |
| 502 @override | 514 @override |
| 503 InterfaceType streamType([DartType elementType]) { | 515 InterfaceType streamType([DartType elementType]) { |
| 504 if (elementType == null) { | 516 if (elementType == null) { |
| 505 return getRawType(streamClass); | 517 return getRawType(streamClass); |
| 506 } | 518 } |
| 507 return createInterfaceType(streamClass, [elementType]); | 519 return createInterfaceType(streamClass, [elementType]); |
| 508 } | 520 } |
| 509 } | 521 } |
| OLD | NEW |