Revert ""Add parameter to function" for TYPE_MISMATCH: fix it works correctly for extension function"
This reverts commit 03e725d5
This commit is contained in:
@@ -146,8 +146,7 @@ class AddFunctionParametersFix(
|
|||||||
argument,
|
argument,
|
||||||
validator
|
validator
|
||||||
)
|
)
|
||||||
val receiverCount = if (descriptor.receiver != null) 1 else 0
|
descriptor.addParameter(argumentIndex, parameterInfo)
|
||||||
descriptor.addParameter(argumentIndex + receiverCount, parameterInfo)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-8
@@ -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<caret>, 0)
|
|
||||||
}
|
|
||||||
Vendored
-8
@@ -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)
|
|
||||||
}
|
|
||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 1st parameter to function 'foo'" "true"
|
// "Add 1st parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 1st parameter to function 'foo'" "true"
|
// "Add 1st parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i11: String, i1: Int, i2: Int, i3: Int, i4: Int) {
|
fun foo(i11: String, i1: Int, i2: Int, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 2nd parameter to function 'foo'" "true"
|
// "Add 2nd parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 2nd parameter to function 'foo'" "true"
|
// "Add 2nd parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i21: String, i2: Int, i3: Int, i4: Int) {
|
fun foo(i1: Int, i21: String, i2: Int, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 3rd parameter to function 'foo'" "true"
|
// "Add 3rd parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 3rd parameter to function 'foo'" "true"
|
// "Add 3rd parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i2: Int, i31: String, i3: Int, i4: Int) {
|
fun foo(i1: Int, i2: Int, i31: String, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 4th parameter to function 'foo'" "true"
|
// "Add 4th parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
fun foo(i1: Int, i2: Int, i3: Int, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
// "Add 4th parameter to function 'foo'" "true"
|
// "Add 4th parameter to function 'foo'" "true"
|
||||||
|
// DISABLE-ERRORS
|
||||||
fun foo(i1: Int, i2: Int, i3: Int, i41: String, i4: Int) {
|
fun foo(i1: Int, i2: Int, i3: Int, i41: String, i4: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2306,11 +2306,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
|||||||
runTest("idea/testData/quickfix/changeSignature/addEnumConstructorParameter5.kt");
|
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")
|
@TestMetadata("addForItParameter.kt")
|
||||||
public void testAddForItParameter() throws Exception {
|
public void testAddForItParameter() throws Exception {
|
||||||
runTest("idea/testData/quickfix/changeSignature/addForItParameter.kt");
|
runTest("idea/testData/quickfix/changeSignature/addForItParameter.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user