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

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

Issue 1499533002: Fix some inference corner case crashes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | 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 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();
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698