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

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

Issue 2280463002: fix #27134, future unions in downwards generic method inference (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: format Created 4 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/lib/src/generated/static_type_analyzer.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 analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 7242 matching lines...) Expand 10 before | Expand all | Expand 10 after
7253 void _inferArgumentTypesFromContext(InvocationExpression node) { 7253 void _inferArgumentTypesFromContext(InvocationExpression node) {
7254 if (!strongMode) { 7254 if (!strongMode) {
7255 // Use propagated type inference for lambdas if not in strong mode. 7255 // Use propagated type inference for lambdas if not in strong mode.
7256 _inferFunctionExpressionsParametersTypes(node.argumentList); 7256 _inferFunctionExpressionsParametersTypes(node.argumentList);
7257 return; 7257 return;
7258 } 7258 }
7259 7259
7260 DartType contextType = node.staticInvokeType; 7260 DartType contextType = node.staticInvokeType;
7261 if (contextType is FunctionType) { 7261 if (contextType is FunctionType) {
7262 DartType originalType = node.function.staticType; 7262 DartType originalType = node.function.staticType;
7263 DartType returnContextType = InferenceContext.getType(node); 7263 DartType returnContextType = InferenceContext.getContext(node);
7264 TypeSystem ts = typeSystem; 7264 TypeSystem ts = typeSystem;
7265 if (returnContextType != null && 7265 if (returnContextType != null &&
7266 node.typeArguments == null && 7266 node.typeArguments == null &&
7267 originalType is FunctionType && 7267 originalType is FunctionType &&
7268 originalType.typeFormals.isNotEmpty && 7268 originalType.typeFormals.isNotEmpty &&
7269 ts is StrongTypeSystemImpl) { 7269 ts is StrongTypeSystemImpl) {
7270 contextType = ts.inferGenericFunctionCall(typeProvider, originalType, 7270 contextType = ts.inferGenericFunctionCall(typeProvider, originalType,
7271 DartType.EMPTY_LIST, DartType.EMPTY_LIST, returnContextType); 7271 DartType.EMPTY_LIST, DartType.EMPTY_LIST, returnContextType);
7272 } 7272 }
7273 7273
(...skipping 3897 matching lines...) Expand 10 before | Expand all | Expand 10 after
11171 return null; 11171 return null;
11172 } 11172 }
11173 if (identical(node.staticElement, variable)) { 11173 if (identical(node.staticElement, variable)) {
11174 if (node.inSetterContext()) { 11174 if (node.inSetterContext()) {
11175 result = true; 11175 result = true;
11176 } 11176 }
11177 } 11177 }
11178 return null; 11178 return null;
11179 } 11179 }
11180 } 11180 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698