Minor: check that invoke() usages search doesn't find overrides
This commit is contained in:
+12
-4
@@ -3,7 +3,7 @@
|
|||||||
package pack
|
package pack
|
||||||
|
|
||||||
open class B(val n: Int) {
|
open class B(val n: Int) {
|
||||||
operator fun <caret>invoke(i: Int){}
|
open operator fun <caret>invoke(i: Int){}
|
||||||
}
|
}
|
||||||
|
|
||||||
object Obj : B(0)
|
object Obj : B(0)
|
||||||
@@ -11,11 +11,19 @@ object Obj : B(0)
|
|||||||
fun f() = B(1)
|
fun f() = B(1)
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
f(1).invoke(2)
|
f().invoke(2)
|
||||||
f(2)(2)
|
f()(2)
|
||||||
|
|
||||||
val v = Obj
|
val v = Obj
|
||||||
v(1)
|
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
@@ -1,14 +1,18 @@
|
|||||||
Checked type of pack.f()
|
Checked type of pack.f()
|
||||||
Checked type of v
|
Checked type of v
|
||||||
Resolved f(1)
|
Resolved c(5)
|
||||||
Resolved f(2)
|
Resolved f()
|
||||||
Resolved f(2)(2)
|
Resolved f()
|
||||||
Resolved listOf(pack.Obj)[0](1)
|
Resolved f()(2)
|
||||||
|
Resolved listOf(Obj)[0](1)
|
||||||
Resolved v(1)
|
Resolved v(1)
|
||||||
Searched references to pack.B
|
Searched references to pack.B
|
||||||
|
Searched references to pack.C
|
||||||
Searched references to pack.Obj
|
Searched references to pack.Obj
|
||||||
Searched references to pack.f() in non-Java files
|
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
|
Searched references to v in non-Java files
|
||||||
Used plain search of pack.B.invoke(i: Int) in LocalSearchScope:
|
Used plain search of pack.B.invoke(i: Int) in LocalSearchScope:
|
||||||
CLASS:B
|
CLASS:B
|
||||||
|
CLASS:C
|
||||||
OBJECT_DECLARATION:Obj
|
OBJECT_DECLARATION:Obj
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Function call 14 f(1).invoke(2)
|
Function call 14 f().invoke(2)
|
||||||
Implicit 'invoke' 15 f(2)(2)
|
Implicit 'invoke' 15 f()(2)
|
||||||
Implicit 'invoke' 18 v(1)
|
Implicit 'invoke' 18 v(1)
|
||||||
Implicit 'invoke' 20 listOf(pack.Obj)[0](1)
|
Implicit 'invoke' 20 listOf(Obj)[0](1)
|
||||||
Reference in New Issue
Block a user