Finding implicit usages of companion object in containing class.

This commit is contained in:
Evgeny Gerashchenko
2015-03-18 22:14:01 +03:00
parent 64937f0ccf
commit efccde2c0b
6 changed files with 75 additions and 4 deletions
@@ -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