OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.resolution.types; | 5 library dart2js.resolution.types; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
10 import '../elements/elements.dart' | 10 import '../elements/elements.dart' |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 userProvidedBadType: typeVariable.type); | 215 userProvidedBadType: typeVariable.type); |
216 } else { | 216 } else { |
217 type = typeVariable.type; | 217 type = typeVariable.type; |
218 } | 218 } |
219 type = checkNoTypeArguments(type); | 219 type = checkNoTypeArguments(type); |
220 } else { | 220 } else { |
221 reporter.internalError( | 221 reporter.internalError( |
222 node, "Unexpected element kind ${element.kind}."); | 222 node, "Unexpected element kind ${element.kind}."); |
223 } | 223 } |
224 if (addTypeVariableBoundsCheck) { | 224 if (addTypeVariableBoundsCheck) { |
225 registry.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK); | |
226 visitor.addDeferredAction(visitor.enclosingElement, | 225 visitor.addDeferredAction(visitor.enclosingElement, |
227 () => checkTypeVariableBounds(node, type)); | 226 () => checkTypeVariableBounds(node, type)); |
228 } | 227 } |
229 } | 228 } |
230 registry.useType(node, type); | 229 registry.useType(node, type); |
231 return type; | 230 return type; |
232 } | 231 } |
233 | 232 |
234 /// Checks the type arguments of [type] against the type variable bounds. | 233 /// Checks the type arguments of [type] against the type variable bounds. |
235 void checkTypeVariableBounds(TypeAnnotation node, GenericType type) { | 234 void checkTypeVariableBounds(TypeAnnotation node, GenericType type) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 arguments.add(argType); | 275 arguments.add(argType); |
277 } | 276 } |
278 if (index < expectedVariables) { | 277 if (index < expectedVariables) { |
279 reporter.reportWarningMessage( | 278 reporter.reportWarningMessage( |
280 node.typeArguments, MessageKind.MISSING_TYPE_ARGUMENT); | 279 node.typeArguments, MessageKind.MISSING_TYPE_ARGUMENT); |
281 typeArgumentCountMismatch = true; | 280 typeArgumentCountMismatch = true; |
282 } | 281 } |
283 return typeArgumentCountMismatch; | 282 return typeArgumentCountMismatch; |
284 } | 283 } |
285 } | 284 } |
OLD | NEW |