Add JetMultiDeclarationReference
A reference to component* functions
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package test
|
||||
|
||||
import dependency.*
|
||||
|
||||
fun <Int> f(l: List<Int>) {
|
||||
val (e<caret>l1, el2, el3) = l
|
||||
}
|
||||
|
||||
// MULTIRESOLVE
|
||||
// REF: (for kotlin.List<T> in dependency).component1()
|
||||
// REF: (for kotlin.List<T> in dependency).component2()
|
||||
// REF: (for kotlin.List<T> in dependency).component3()
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package dependency
|
||||
|
||||
fun <T> List<T>.component1() = get(0)
|
||||
fun <T> List<T>.component2() = get(1)
|
||||
fun <T> List<T>.component3() = get(2)
|
||||
@@ -0,0 +1,15 @@
|
||||
package a
|
||||
|
||||
class A() {
|
||||
}
|
||||
|
||||
fun A.component1() = 1
|
||||
fun A.component2() = 1
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val (a,<caret> b) = A()
|
||||
}
|
||||
|
||||
// MULTIRESOLVE
|
||||
// REF: (for A in a).component1()
|
||||
// REF: (for A in a).component2()
|
||||
@@ -0,0 +1,10 @@
|
||||
package a
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val p = Pair(1, 2)
|
||||
val (a, b<caret>) = p
|
||||
}
|
||||
|
||||
// MULTIRESOLVE
|
||||
// REF: (in kotlin.Pair).component1()
|
||||
// REF: (in kotlin.Pair).component2()
|
||||
Reference in New Issue
Block a user