Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1307353002: Band-aid fix for issue #24191. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698