Finding implicit usages of companion object in containing class.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetObjectDeclaration
|
||||
// OPTIONS: usages
|
||||
class A {
|
||||
init {
|
||||
foo()
|
||||
v
|
||||
|
||||
1[2] // using companion object function by convention
|
||||
|
||||
ext() // companion object is extension receiver
|
||||
}
|
||||
|
||||
companion <caret>object: Foo {
|
||||
fun foo() {
|
||||
}
|
||||
|
||||
val v = 42
|
||||
|
||||
fun Int.get(a: Int) = this + a
|
||||
}
|
||||
}
|
||||
|
||||
trait Foo
|
||||
|
||||
fun Foo.ext() {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
Function call (10: 9) ext() // companion object is extension receiver
|
||||
Function call (5: 9) foo()
|
||||
Implicit 'get' (8: 9) 1[2] // using companion object function by convention
|
||||
Value read (6: 9) v
|
||||
Reference in New Issue
Block a user