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

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.dart

Issue 2295853002: fix #26992, inference failures are now an error (Closed)
Patch Set: fix comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index d6787516f05949c6217b0ce300563e99db1685a2..b7d45f75057990c42574d50559467fe5960a407b 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1905,8 +1905,8 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
*/
void _inferGenericInvocationExpression(InvocationExpression node) {
ArgumentList arguments = node.argumentList;
- FunctionType inferred = _inferGenericInvoke(
- node, node.function.staticType, node.typeArguments, arguments);
+ FunctionType inferred = _inferGenericInvoke(node, node.function.staticType,
+ node.typeArguments, arguments, node.function);
if (inferred != null && inferred != node.staticInvokeType) {
// Fix up the parameter elements based on inferred method.
arguments.correspondingStaticParameters = ResolverVisitor
@@ -1923,8 +1923,12 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
* This takes into account both the context type, as well as information from
* the argument types.
*/
- FunctionType _inferGenericInvoke(Expression node, DartType fnType,
- TypeArgumentList typeArguments, ArgumentList argumentList) {
+ FunctionType _inferGenericInvoke(
+ Expression node,
+ DartType fnType,
+ TypeArgumentList typeArguments,
+ ArgumentList argumentList,
+ AstNode errorNode) {
TypeSystem ts = _typeSystem;
if (typeArguments == null &&
fnType is FunctionType &&
@@ -1982,7 +1986,8 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
}
}
return ts.inferGenericFunctionCall(_typeProvider, fnType, paramTypes,
- argTypes, InferenceContext.getContext(node));
+ argTypes, InferenceContext.getContext(node),
+ errorReporter: _resolver.errorReporter, errorNode: errorNode);
}
return null;
}
@@ -2020,8 +2025,8 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
_constructorToGenericFunctionType(rawElement);
ArgumentList arguments = node.argumentList;
- FunctionType inferred = _inferGenericInvoke(
- node, constructorType, constructor.type.typeArguments, arguments);
+ FunctionType inferred = _inferGenericInvoke(node, constructorType,
+ constructor.type.typeArguments, arguments, node.constructorName);
if (inferred != null && inferred != originalElement.type) {
// Fix up the parameter elements based on inferred method.
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698