Implemented fast search for invoke operator calls
#KT-13643 Fixed
This commit is contained in:
+5
-3
@@ -2,10 +2,12 @@
|
||||
// OPTIONS: usages
|
||||
|
||||
class B(val n: Int) {
|
||||
fun <caret>invoke(i: Int): B = B(i)
|
||||
operator fun <caret>invoke(i: Int){}
|
||||
}
|
||||
|
||||
fun f() = B(1)
|
||||
|
||||
fun test() {
|
||||
B(1).invoke(2)
|
||||
B(1)(2)
|
||||
f(1).invoke(2)
|
||||
f(2)(2)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Checked type of f()
|
||||
Resolving call f(1)
|
||||
Resolving call f(2)
|
||||
Resolving call f(2)(2)
|
||||
Searched references to B
|
||||
Searched references to f() in Kotlin files
|
||||
Used plain search in LocalSearchScope:
|
||||
CLASS:B
|
||||
@@ -1 +1,2 @@
|
||||
Function call 9 B(1).invoke(2)
|
||||
Function call 11 f(1).invoke(2)
|
||||
Implicit 'invoke' 12 f(2)(2)
|
||||
@@ -4,5 +4,5 @@ class A(val n: Int) {
|
||||
|
||||
fun test() {
|
||||
A(1).foo(2)
|
||||
A(1)(2)
|
||||
A(1).foo(2)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class B(val n: Int) {
|
||||
operator fun <caret>invoke(i: Int){}
|
||||
}
|
||||
|
||||
fun f() = B(1)
|
||||
|
||||
fun test() {
|
||||
f(1).invoke(2)
|
||||
f(2)(2)
|
||||
}
|
||||
Reference in New Issue
Block a user