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 063cd3955c593f5222fb4f009d91e714c79acab9..60192d24b231dff5f91220f95db5183c1af8ab87 100644 |
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
@@ -1828,7 +1828,10 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> { |
if (element is ExecutableElement && |
fnType is FunctionTypeImpl && |
ts is StrongTypeSystemImpl) { |
- List<Expression> arguments = node.argumentList.arguments; |
+ // We may have too many (or too few) arguments. Only use arguments |
+ // which have been matched up with a static parameter. |
+ Iterable<Expression> arguments = node.argumentList.arguments |
+ .where((e) => e.staticParameterElement != null); |
List<DartType> argTypes = arguments.map((e) => e.staticType).toList(); |
List<DartType> paramTypes = |
arguments.map((e) => e.staticParameterElement.type).toList(); |