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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 1776353003: Issue 25962. Check for the number of arguments vs. number of required parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 3fdd5f9a3db8a3b7a43e2afc1012365455acbf5e..38fda9be308aa7abcdbc57e059926bf9e9602740 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -428,7 +428,11 @@ class FixProcessor {
.takeWhile((p) => p.parameterKind == ParameterKind.REQUIRED);
Iterable<ParameterElement> optionalParameters = parameters
.skipWhile((p) => p.parameterKind == ParameterKind.REQUIRED);
+ // prepare the argument to add a new parameter for
int numRequired = requiredParameters.length;
+ if (numRequired >= arguments.length) {
+ return;
+ }
Expression argument = arguments[numRequired];
// prepare target
int targetOffset;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698