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; |