"Redundant Companion": Don't suggest if same callable name is in use
So #KT-24425 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a2435ff3b0
commit
5ad98a139d
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
companion object {
|
||||
fun f(x: Int, y: Int) = 1
|
||||
}
|
||||
|
||||
fun f(x: Int, y: String) = 2
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.f(1, 2)
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
companion object {
|
||||
fun f(x: Int, y: Int) = 1
|
||||
}
|
||||
|
||||
fun f(x: Int, y: String) = 2
|
||||
|
||||
fun test() {
|
||||
f(1, 2)
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
fun extentionFun() = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.extentionFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun Test.extentionFun() = 2
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
val extentionVar = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.extentionVar
|
||||
}
|
||||
}
|
||||
|
||||
val Test.extentionVar: Int
|
||||
get() = 2
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
companion object {
|
||||
fun globalFun() = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.globalFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun globalFun() = 2
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
companion object {
|
||||
fun globalFun() = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
globalFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun globalFun() = 2
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
companion object {
|
||||
val globalVar = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.globalVar
|
||||
}
|
||||
}
|
||||
|
||||
val globalVar = 2
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
companion object {
|
||||
val globalVar = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
globalVar
|
||||
}
|
||||
}
|
||||
|
||||
val globalVar = 2
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
fun localFun() = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
fun localFun() = 2
|
||||
|
||||
<caret>Companion.localFun()
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
val localVar = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
var localVar = 2
|
||||
|
||||
<caret>Companion.localVar
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
val localVar = 1
|
||||
}
|
||||
|
||||
fun test(localVar: Int) {
|
||||
<caret>Companion.localVar
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
fun memberFun(x: Int) = 1
|
||||
}
|
||||
|
||||
fun memberFun(x: Int) = 2
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.memberFun(0)
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// PROBLEM: none
|
||||
|
||||
class Test {
|
||||
companion object {
|
||||
val memberVar = 1
|
||||
}
|
||||
|
||||
val memberVar = 2
|
||||
|
||||
fun test() {
|
||||
<caret>Companion.memberVar
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user