DeprecatedSymbolUsageFix - dealing with infix and operator calls

This commit is contained in:
Valentin Kipyatkov
2015-05-19 19:06:12 +03:00
parent 33caa7ad36
commit 08cfca56f8
10 changed files with 180 additions and 29 deletions
@@ -0,0 +1,12 @@
// "Replace with 'newFun(p, this)'" "true"
@deprecated("", ReplaceWith("newFun(p, this)"))
fun String.oldFun(p: Int) {
newFun(p, this)
}
fun newFun(p: Int, s: String){}
fun foo() {
"" <caret>oldFun 1
}
@@ -0,0 +1,12 @@
// "Replace with 'newFun(p, this)'" "true"
@deprecated("", ReplaceWith("newFun(p, this)"))
fun String.oldFun(p: Int) {
newFun(p, this)
}
fun newFun(p: Int, s: String){}
fun foo() {
<caret>newFun(1, "")
}
@@ -0,0 +1,13 @@
// "Replace with 'newFun(p)'" "true"
@deprecated("", ReplaceWith("newFun(p)"))
fun String.oldFun(p: Int) {
newFun(p)
}
fun String.newFun(p: Int) {
}
fun foo() {
"" <caret>oldFun 1
}
@@ -0,0 +1,13 @@
// "Replace with 'newFun(p)'" "true"
@deprecated("", ReplaceWith("newFun(p)"))
fun String.oldFun(p: Int) {
newFun(p)
}
fun String.newFun(p: Int) {
}
fun foo() {
"" <caret>newFun 1
}
@@ -0,0 +1,14 @@
// "Replace with 'newFun(p, this)'" "true"
interface I
@deprecated("", ReplaceWith("newFun(p, this)"))
fun I.plus(p: Int) {
newFun(p, this)
}
fun newFun(p: Int, i: I) { }
fun foo(i: I) {
i <caret>+ 1
}
@@ -0,0 +1,14 @@
// "Replace with 'newFun(p, this)'" "true"
interface I
@deprecated("", ReplaceWith("newFun(p, this)"))
fun I.plus(p: Int) {
newFun(p, this)
}
fun newFun(p: Int, i: I) { }
fun foo(i: I) {
<caret>newFun(1, i)
}
@@ -0,0 +1,14 @@
// "Replace with 'newFun(p)'" "true"
interface I
@deprecated("", ReplaceWith("newFun(p)"))
fun I.plus(p: Int) {
newFun(p)
}
fun I.newFun(p: Int){}
fun foo(i: I) {
i <caret>+ 1
}
@@ -0,0 +1,14 @@
// "Replace with 'newFun(p)'" "true"
interface I
@deprecated("", ReplaceWith("newFun(p)"))
fun I.plus(p: Int) {
newFun(p)
}
fun I.newFun(p: Int){}
fun foo(i: I) {
i.<caret>newFun(1)
}