Provide quick fix for migration of single elements in named arguments

See more in KT-20171
This commit is contained in:
Mikhail Zarechenskiy
2017-09-26 12:03:22 +03:00
parent 8ab7c26cae
commit 8a545f05de
14 changed files with 164 additions and 5 deletions
@@ -0,0 +1,8 @@
// "Surround with *arrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
fun anyFoo(vararg a: Any) {}
fun test() {
anyFoo(a = intArr<caret>ayOf(1))
}
@@ -0,0 +1,8 @@
// "Surround with *arrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
fun anyFoo(vararg a: Any) {}
fun test() {
anyFoo(a = *arrayOf(intArrayOf(1)))
}
@@ -0,0 +1,8 @@
// "Surround with *intArrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
fun foo(vararg s: Int) {}
fun test() {
foo(s = <caret>1)
}
@@ -0,0 +1,8 @@
// "Surround with *intArrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
fun foo(vararg s: Int) {}
fun test() {
foo(s = <caret>*intArrayOf(1))
}
@@ -0,0 +1,8 @@
// "Surround with *arrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
fun foo(vararg s: String) {}
fun test() {
foo(s = <caret>"value")
}
@@ -0,0 +1,8 @@
// "Surround with *arrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
fun foo(vararg s: String) {}
fun test() {
foo(s = *arrayOf("value"))
}
@@ -0,0 +1,8 @@
// "Surround with *arrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
class Foo<T>(vararg val p: T)
fun test() {
Foo(p = 123<caret>)
}
@@ -0,0 +1,8 @@
// "Surround with *arrayOf(...)" "true"
// LANGUAGE_VERSION: 1.2
class Foo<T>(vararg val p: T)
fun test() {
Foo(p = *arrayOf(123))
}