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 library dart_types; | 5 library dart_types; |
6 | 6 |
7 import 'dart:math' show min; | 7 import 'dart:math' show min; |
8 | 8 |
9 import 'common/resolution.dart' show Resolution; | 9 import 'common/resolution.dart' show Resolution; |
10 import 'common.dart'; | 10 import 'common.dart'; |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 bool invalidCallableType(DartType callType, DartType s) { | 1273 bool invalidCallableType(DartType callType, DartType s) { |
1274 return !isSubtype(callType, s); | 1274 return !isSubtype(callType, s); |
1275 } | 1275 } |
1276 } | 1276 } |
1277 | 1277 |
1278 /** | 1278 /** |
1279 * Callback used to check whether the [typeArgument] of [type] is a valid | 1279 * Callback used to check whether the [typeArgument] of [type] is a valid |
1280 * substitute for the bound of [typeVariable]. [bound] holds the bound against | 1280 * substitute for the bound of [typeVariable]. [bound] holds the bound against |
1281 * which [typeArgument] should be checked. | 1281 * which [typeArgument] should be checked. |
1282 */ | 1282 */ |
1283 typedef void CheckTypeVariableBound(GenericType type, DartType typeArgument, | 1283 typedef CheckTypeVariableBound = void Function(GenericType type, DartType typeAr
gument, |
1284 TypeVariableType typeVariable, DartType bound); | 1284 TypeVariableType typeVariable, DartType bound); |
1285 | 1285 |
1286 /// Basic interface for the Dart type system. | 1286 /// Basic interface for the Dart type system. |
1287 abstract class DartTypes { | 1287 abstract class DartTypes { |
1288 /// The types defined in 'dart:core'. | 1288 /// The types defined in 'dart:core'. |
1289 CoreTypes get coreTypes; | 1289 CoreTypes get coreTypes; |
1290 | 1290 |
1291 /// Returns `true` if [t] is a subtype of [s]. | 1291 /// Returns `true` if [t] is a subtype of [s]. |
1292 bool isSubtype(DartType t, DartType s); | 1292 bool isSubtype(DartType t, DartType s); |
1293 | 1293 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 sb.write(', '); | 2019 sb.write(', '); |
2020 } | 2020 } |
2021 namedParameterTypes[index].accept(this, namedParameters[index]); | 2021 namedParameterTypes[index].accept(this, namedParameters[index]); |
2022 needsComma = true; | 2022 needsComma = true; |
2023 } | 2023 } |
2024 sb.write('}'); | 2024 sb.write('}'); |
2025 } | 2025 } |
2026 sb.write(')'); | 2026 sb.write(')'); |
2027 } | 2027 } |
2028 } | 2028 } |
OLD | NEW |