Redundant companion reference: fix false positive when companion has same name member as companion name

#KT-36707 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-02-15 10:17:30 +09:00
committed by Vladimir Dolzhenko
parent 98ce49ba73
commit 19093e2e02
6 changed files with 81 additions and 7 deletions
@@ -0,0 +1,13 @@
// PROBLEM: none
class B {
companion object foo {
fun foo() {}
operator fun invoke() {
}
}
fun test() {
<caret>foo.foo()
}
}
@@ -0,0 +1,12 @@
class C {
companion object foo {
fun foo() {}
operator fun invoke(i: Int) {
}
}
fun test() {
<caret>foo.foo()
}
}
@@ -0,0 +1,12 @@
class C {
companion object foo {
fun foo() {}
operator fun invoke(i: Int) {
}
}
fun test() {
foo()
}
}
@@ -0,0 +1,10 @@
// PROBLEM: none
class A {
companion object foo {
val foo = 1
}
fun test() {
<caret>foo.foo
}
}