Redundant companion reference: Fix false positive in enum entry #KT-27861 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-11-05 17:07:55 +09:00
committed by Mikhail Glukhikh
parent d88fd8aa6f
commit 7a9effe30d
7 changed files with 73 additions and 3 deletions
@@ -0,0 +1,13 @@
enum class E {
E1;
fun test() {
bar(<caret>Companion.foo)
}
fun bar(s: String) {}
companion object {
const val foo = ""
}
}
@@ -0,0 +1,13 @@
enum class E {
E1;
fun test() {
bar(foo)
}
fun bar(s: String) {}
companion object {
const val foo = ""
}
}
@@ -0,0 +1,10 @@
// PROBLEM: none
// DISABLE-ERRORS
enum class E(val value: String) {
E1(<caret>Companion.foo);
companion object {
const val foo = ""
}
}
@@ -0,0 +1,9 @@
enum class E(val value: String) {
E1(A.<caret>Companion.foo);
}
class A {
companion object {
const val foo = ""
}
}
@@ -0,0 +1,9 @@
enum class E(val value: String) {
E1(A.foo);
}
class A {
companion object {
const val foo = ""
}
}