Implemented fast search for invoke operator calls

#KT-13643 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-08-31 22:41:47 +03:00
parent e1c7d07189
commit e3b37f9219
13 changed files with 197 additions and 12 deletions
+5 -3
View File
@@ -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)
}
+10
View File
@@ -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)
}