| 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 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |