Fix several false positives and make safer "redundant companion ref"
Don't report it on an import directive #KT-23520 Fixed Don't report it if companion nested class is referenced #KT-23519 Fixed Check companion reference both by descriptor and by name
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Owner {
|
||||
companion object {
|
||||
class InCompanion {
|
||||
class Nested
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val y = Owner.<caret>Companion.InCompanion.Nested()
|
||||
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Owner {
|
||||
companion object {
|
||||
class InCompanion
|
||||
}
|
||||
}
|
||||
|
||||
val y = Owner.<caret>Companion.InCompanion()
|
||||
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
|
||||
import Owner.<caret>Companion.some
|
||||
|
||||
class Owner {
|
||||
companion object {
|
||||
const val some = ""
|
||||
}
|
||||
}
|
||||
|
||||
class User {
|
||||
val anything = some
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class C {
|
||||
companion object Obj {
|
||||
fun create() = C()
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
C.<caret>Obj.create()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class C {
|
||||
companion object Obj {
|
||||
fun create() = C()
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
C.create()
|
||||
}
|
||||
Reference in New Issue
Block a user