AddFunctionParametersFix: use argument name as parameter name if argument is referenced variable
#KT-14021 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
8b8059acdd
commit
19d1532dc7
+7
@@ -0,0 +1,7 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo() {}
|
||||
|
||||
fun test(isObject: Boolean) {
|
||||
foo(isObject<caret>)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo(isObject: Boolean) {}
|
||||
|
||||
fun test(isObject: Boolean) {
|
||||
foo(isObject)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add parameter to function 'bar'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun bar(isObject: Boolean) {}
|
||||
|
||||
fun test(isObject: Boolean) {
|
||||
bar(true, isObject<caret>)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add parameter to function 'bar'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun bar(isObject: Boolean, isObject1: Boolean) {}
|
||||
|
||||
fun test(isObject: Boolean) {
|
||||
bar(true, isObject)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo() {}
|
||||
|
||||
fun test(isObject: Boolean) {
|
||||
foo((isObject)<caret>)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo(isObject: Boolean) {}
|
||||
|
||||
fun test(isObject: Boolean) {
|
||||
foo((isObject))
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo() {}
|
||||
|
||||
fun bar(f: (String) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
bar {
|
||||
foo(it<caret>)
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo(s: String) {}
|
||||
|
||||
fun bar(f: (String) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
bar {
|
||||
foo(it)
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo() {}
|
||||
|
||||
class Test {
|
||||
val x: String = ""
|
||||
get() {
|
||||
foo(field<caret>)
|
||||
return field
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Add parameter to function 'foo'" "true"
|
||||
// DISABLE-ERRORS
|
||||
fun foo(s: String) {}
|
||||
|
||||
class Test {
|
||||
val x: String = ""
|
||||
get() {
|
||||
foo(field)
|
||||
return field
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user