| 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 library engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'ast.dart'; | 9 import 'ast.dart'; |
| 10 import 'constant.dart'; | 10 import 'constant.dart'; |
| (...skipping 11247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11258 if (listenParameters == null || listenParameters.length < 1) { | 11258 if (listenParameters == null || listenParameters.length < 1) { |
| 11259 return null; | 11259 return null; |
| 11260 } | 11260 } |
| 11261 DartType onDataType = listenParameters[0].type; | 11261 DartType onDataType = listenParameters[0].type; |
| 11262 if (onDataType is FunctionType) { | 11262 if (onDataType is FunctionType) { |
| 11263 List<ParameterElement> onDataParameters = onDataType.parameters; | 11263 List<ParameterElement> onDataParameters = onDataType.parameters; |
| 11264 if (onDataParameters == null || onDataParameters.length < 1) { | 11264 if (onDataParameters == null || onDataParameters.length < 1) { |
| 11265 return null; | 11265 return null; |
| 11266 } | 11266 } |
| 11267 DartType eventType = onDataParameters[0].type; | 11267 DartType eventType = onDataParameters[0].type; |
| 11268 if (eventType.element == streamType.typeParameters[0]) { | 11268 // TODO(paulberry): checking that typeParameters.isNotEmpty is a |
| 11269 // band-aid fix for dartbug.com/24191. Figure out what the correct |
| 11270 // logic should be. |
| 11271 if (streamType.typeParameters.isNotEmpty && |
| 11272 eventType.element == streamType.typeParameters[0]) { |
| 11269 return streamType.typeArguments[0]; | 11273 return streamType.typeArguments[0]; |
| 11270 } | 11274 } |
| 11271 } | 11275 } |
| 11272 } | 11276 } |
| 11273 return null; | 11277 return null; |
| 11274 } | 11278 } |
| 11275 | 11279 |
| 11276 /** | 11280 /** |
| 11277 * If given "mayBeClosure" is [FunctionExpression] without explicit parameters
types and its | 11281 * If given "mayBeClosure" is [FunctionExpression] without explicit parameters
types and its |
| 11278 * required type is [FunctionType], then infer parameters types from [Function
Type]. | 11282 * required type is [FunctionType], then infer parameters types from [Function
Type]. |
| (...skipping 4044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15323 nonFields.add(node); | 15327 nonFields.add(node); |
| 15324 return null; | 15328 return null; |
| 15325 } | 15329 } |
| 15326 | 15330 |
| 15327 @override | 15331 @override |
| 15328 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 15332 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
| 15329 | 15333 |
| 15330 @override | 15334 @override |
| 15331 Object visitWithClause(WithClause node) => null; | 15335 Object visitWithClause(WithClause node) => null; |
| 15332 } | 15336 } |
| OLD | NEW |