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

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

Issue 1579503005: fix #25409, error if a generic method argument did not have a corresponding parameter (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/resolver.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.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 28f42f74b199ec679e8bf7b4900c57e3f325ef50..fdda79a83b6a617b25e2b48f3238eafa459ba8a8 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1813,16 +1813,18 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
if (fnType.typeFormals.isNotEmpty &&
ts.instantiateToBounds(fnType) == invokeType) {
// Get the parameters that correspond to the uninstantiated generic.
- List<ParameterElement> genericParameters =
+ List<ParameterElement> rawParameters =
ResolverVisitor.resolveArgumentsToParameters(
node.argumentList, fnType.parameters, null);
- int length = genericParameters.length;
- List<DartType> argTypes = new List<DartType>(length);
- List<DartType> paramTypes = new List<DartType>(length);
- for (int i = 0; i < length; i++) {
- argTypes[i] = node.argumentList.arguments[i].staticType;
- paramTypes[i] = genericParameters[i].type;
+ List<DartType> paramTypes = <DartType>[];
+ List<DartType> argTypes = <DartType>[];
+ for (int i = 0, length = rawParameters.length; i < length; i++) {
+ ParameterElement parameter = rawParameters[i];
+ if (parameter != null) {
+ paramTypes.add(parameter.type);
+ argTypes.add(node.argumentList.arguments[i].staticType);
+ }
}
FunctionType inferred = ts.inferCallFromArguments(
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/task/strong/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698