Introduce Variable: Support destructuring declarations
#KT-6262
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class A
|
||||
|
||||
fun A.component1() = 1
|
||||
fun A.component2() = 2
|
||||
|
||||
fun test() {
|
||||
<selection>A()</selection>
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A
|
||||
|
||||
fun A.component1() = 1
|
||||
fun A.component2() = 2
|
||||
|
||||
fun test() {
|
||||
val a = A()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A
|
||||
|
||||
operator fun A.component1() = 1
|
||||
|
||||
fun test() {
|
||||
<selection>A()</selection>
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A
|
||||
|
||||
operator fun A.component1() = 1
|
||||
|
||||
fun test() {
|
||||
val a = A()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class A
|
||||
|
||||
operator fun A.component1() = 1
|
||||
operator fun A.component2() = 2
|
||||
|
||||
class B {
|
||||
operator fun A.component3() = 3
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<selection>A()</selection>
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
class A
|
||||
|
||||
operator fun A.component1() = 1
|
||||
operator fun A.component2() = 2
|
||||
|
||||
class B {
|
||||
operator fun A.component3() = 3
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val (i, i1) = A()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
<selection>1 to 2</selection>
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (i, i1) = 1 to 2
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
(<selection>1 to 2</selection>).first
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val pair = 1 to 2
|
||||
pair.first
|
||||
}
|
||||
Reference in New Issue
Block a user