Minor: check that invoke() usages search doesn't find overrides

This commit is contained in:
Nikolay Krasko
2017-04-10 16:13:34 +03:00
parent d0a26cf052
commit eb941c75f9
3 changed files with 23 additions and 11 deletions
+12 -4
View File
@@ -3,7 +3,7 @@
package pack
open class B(val n: Int) {
operator fun <caret>invoke(i: Int){}
open operator fun <caret>invoke(i: Int){}
}
object Obj : B(0)
@@ -11,11 +11,19 @@ object Obj : B(0)
fun f() = B(1)
fun test() {
f(1).invoke(2)
f(2)(2)
f().invoke(2)
f()(2)
val v = Obj
v(1)
listOf(pack.Obj)[0](1)
listOf(Obj)[0](1)
}
class C(): B(12) {
override fun invoke(i: Int) {}
}
fun cTest(c: C) {
c(5)
}
+8 -4
View File
@@ -1,14 +1,18 @@
Checked type of pack.f()
Checked type of v
Resolved f(1)
Resolved f(2)
Resolved f(2)(2)
Resolved listOf(pack.Obj)[0](1)
Resolved c(5)
Resolved f()
Resolved f()
Resolved f()(2)
Resolved listOf(Obj)[0](1)
Resolved v(1)
Searched references to pack.B
Searched references to pack.C
Searched references to pack.Obj
Searched references to pack.f() in non-Java files
Searched references to parameter c of pack.cTest(c: C) in non-Java files
Searched references to v in non-Java files
Used plain search of pack.B.invoke(i: Int) in LocalSearchScope:
CLASS:B
CLASS:C
OBJECT_DECLARATION:Obj
@@ -1,4 +1,4 @@
Function call 14 f(1).invoke(2)
Implicit 'invoke' 15 f(2)(2)
Function call 14 f().invoke(2)
Implicit 'invoke' 15 f()(2)
Implicit 'invoke' 18 v(1)
Implicit 'invoke' 20 listOf(pack.Obj)[0](1)
Implicit 'invoke' 20 listOf(Obj)[0](1)