diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/AddFunctionParametersFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/AddFunctionParametersFix.kt index 8fb8e94ec6b..5807027ac52 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/AddFunctionParametersFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/AddFunctionParametersFix.kt @@ -146,8 +146,7 @@ class AddFunctionParametersFix( argument, validator ) - val receiverCount = if (descriptor.receiver != null) 1 else 0 - descriptor.addParameter(argumentIndex + receiverCount, parameterInfo) + descriptor.addParameter(argumentIndex, parameterInfo) return } diff --git a/idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt b/idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt deleted file mode 100644 index 4aee89fb796..00000000000 --- a/idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "Add 2nd parameter to function 'bar'" "true" -interface Foo - -private fun Foo.bar(s: String, i: Int) {} - -fun test(foo: Foo, b: Boolean) { - foo.bar("", b, 0) -} \ No newline at end of file diff --git a/idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt.after b/idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt.after deleted file mode 100644 index 1b948222593..00000000000 --- a/idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt.after +++ /dev/null @@ -1,8 +0,0 @@ -// "Add 2nd parameter to function 'bar'" "true" -interface Foo - -private fun Foo.bar(s: String, b: Boolean, i: Int) {} - -fun test(foo: Foo, b: Boolean) { - foo.bar("", b, 0) -} \ No newline at end of file diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt index dbe7bd03f56..b0d530d4179 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt @@ -1,4 +1,5 @@ // "Add 1st parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i2: Int, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt.after b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt.after index a34e70071ff..92ee6ee28e4 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt.after +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch1.kt.after @@ -1,4 +1,5 @@ // "Add 1st parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i11: String, i1: Int, i2: Int, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt index 7682eebc7b7..d3561715121 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt @@ -1,4 +1,5 @@ // "Add 2nd parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i2: Int, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt.after b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt.after index 67140a712ca..9c7920ae268 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt.after +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch2.kt.after @@ -1,4 +1,5 @@ // "Add 2nd parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i21: String, i2: Int, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt index f5504f477f8..196d9fe4aa5 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt @@ -1,4 +1,5 @@ // "Add 3rd parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i2: Int, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt.after b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt.after index 31130e6b3d7..f9253f50376 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt.after +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch3.kt.after @@ -1,4 +1,5 @@ // "Add 3rd parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i2: Int, i31: String, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt index 577f60bc644..dfa9286f3b0 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt @@ -1,4 +1,5 @@ // "Add 4th parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i2: Int, i3: Int, i4: Int) { } diff --git a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt.after b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt.after index 1e956c2bef9..1b634f2f21e 100644 --- a/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt.after +++ b/idea/testData/quickfix/changeSignature/addFunctionParameterForTypeMismatch4.kt.after @@ -1,4 +1,5 @@ // "Add 4th parameter to function 'foo'" "true" +// DISABLE-ERRORS fun foo(i1: Int, i2: Int, i3: Int, i41: String, i4: Int) { } diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index dfa48502dd2..e651eba8be6 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -2306,11 +2306,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/changeSignature/addEnumConstructorParameter5.kt"); } - @TestMetadata("addExtensionFunctionParameterForTypeMismatch.kt") - public void testAddExtensionFunctionParameterForTypeMismatch() throws Exception { - runTest("idea/testData/quickfix/changeSignature/addExtensionFunctionParameterForTypeMismatch.kt"); - } - @TestMetadata("addForItParameter.kt") public void testAddForItParameter() throws Exception { runTest("idea/testData/quickfix/changeSignature/addForItParameter.kt");