Replace deprecated symbol usage: fix message in case of generic parameter

#KT-8958 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-04-15 17:03:12 +09:00
committed by Mikhail Glukhikh
parent e8e457a16c
commit 0fad3fafa8
18 changed files with 149 additions and 23 deletions
@@ -1,4 +1,4 @@
// "Replace with 'B<N>'" "true"
// "Replace with 'B<F<Int>>'" "true"
// WITH_RUNTIME
@Deprecated(message = "renamed", replaceWith = ReplaceWith("B<N>"))
@@ -1,4 +1,4 @@
// "Replace with 'B<N>'" "true"
// "Replace with 'B<F<Int>>'" "true"
// WITH_RUNTIME
@Deprecated(message = "renamed", replaceWith = ReplaceWith("B<N>"))
@@ -1,4 +1,4 @@
// "Replace with 'B<E>'" "true"
// "Replace with 'B<String>'" "true"
// WITH_RUNTIME
@Deprecated(message = "renamed", replaceWith = ReplaceWith("B<E>"))
@@ -1,4 +1,4 @@
// "Replace with 'B<E>'" "true"
// "Replace with 'B<String>'" "true"
// WITH_RUNTIME
@Deprecated(message = "renamed", replaceWith = ReplaceWith("B<E>"))
@@ -0,0 +1,7 @@
// "Replace with 'String::class'" "true"
@Deprecated("Use class literal", ReplaceWith("T::class"))
fun <T> foo() {
}
val x = <caret>foo<String>()
@@ -0,0 +1,7 @@
// "Replace with 'String::class'" "true"
@Deprecated("Use class literal", ReplaceWith("T::class"))
fun <T> foo() {
}
val x = String::class
@@ -0,0 +1,8 @@
// "Replace with 'Int::class.java'" "true"
// WITH_RUNTIME
@Deprecated("Use class literal", ReplaceWith("T::class.java"))
fun <T> foo() {
}
val x = <caret>foo<Int>()
@@ -0,0 +1,8 @@
// "Replace with 'Int::class.java'" "true"
// WITH_RUNTIME
@Deprecated("Use class literal", ReplaceWith("T::class.java"))
fun <T> foo() {
}
val x = Int::class.java
@@ -0,0 +1,13 @@
// "Replace usages of 'old(): Unit' in whole project" "true"
@Deprecated("Use new", ReplaceWith("new<T>()"))
fun <T> old() {
}
fun <T> new() {
}
fun main() {
<caret>old<String>()
old<Int>()
}
@@ -0,0 +1,13 @@
// "Replace usages of 'old(): Unit' in whole project" "true"
@Deprecated("Use new", ReplaceWith("new<T>()"))
fun <T> old() {
}
fun <T> new() {
}
fun main() {
new<String>()
new<Int>()
}
@@ -0,0 +1,8 @@
// "Replace with 'New<String, Int>'" "true"
@Deprecated("Use New", replaceWith = ReplaceWith("New<T, U>"))
class Old<T, U>
class New<T, U>
fun foo(): <caret>Old<String, Int>? = null
@@ -0,0 +1,8 @@
// "Replace with 'New<String, Int>'" "true"
@Deprecated("Use New", replaceWith = ReplaceWith("New<T, U>"))
class Old<T, U>
class New<T, U>
fun foo(): New<String, Int>? = null