Replace deprecated symbol usage: do not include 'Companion' in import directives when importing companion object

#KT-34078 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-10-15 13:59:33 +09:00
committed by Dmitry Gridin
parent 5250421002
commit 48968c0fe2
8 changed files with 81 additions and 1 deletions
@@ -0,0 +1,13 @@
// "Replace with 'A.bar(x)'" "true"
package test
import a.A
@Deprecated("bla", ReplaceWith("A.bar(x)", "a.A"))
fun foo(x: Any) {
}
fun test() {
A.bar(1)
}
@@ -0,0 +1,7 @@
package a
class A {
companion object {
fun bar(x: Any) {}
}
}
@@ -0,0 +1,11 @@
// "Replace with 'A.bar(x)'" "true"
package test
@Deprecated("bla", ReplaceWith("A.bar(x)", "a.A"))
fun foo(x: Any) {
}
fun test() {
<caret>foo(1)
}
@@ -0,0 +1,13 @@
// "Replace with 'A.bar(x)'" "true"
package test
import a.A
@Deprecated("bla", ReplaceWith("A.bar(x)", "a.A"))
fun foo(x: Any) {
}
fun test() {
A.bar(1)
}
@@ -0,0 +1,7 @@
package a
class A {
companion object F {
fun bar(x: Any) {}
}
}
@@ -0,0 +1,11 @@
// "Replace with 'A.bar(x)'" "true"
package test
@Deprecated("bla", ReplaceWith("A.bar(x)", "a.A"))
fun foo(x: Any) {
}
fun test() {
<caret>foo(1)
}