DeprecatedSymbolUsageFix: can drop more arguments when function literal argument exist
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p1, p2)'" "true"
|
||||
|
||||
interface I {
|
||||
@deprecated("", ReplaceWith("newFun(p1, p2)"))
|
||||
fun oldFun(p1: String = "", p2: Int = 0)
|
||||
|
||||
fun newFun(p1: String = "", p2: Int = 0, p3: Int = -1)
|
||||
}
|
||||
|
||||
fun foo(i: I) {
|
||||
i.<caret>oldFun()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p1, p2)'" "true"
|
||||
|
||||
interface I {
|
||||
@deprecated("", ReplaceWith("newFun(p1, p2)"))
|
||||
fun oldFun(p1: String = "", p2: Int = 0)
|
||||
|
||||
fun newFun(p1: String = "", p2: Int = 0, p3: Int = -1)
|
||||
}
|
||||
|
||||
fun foo(i: I) {
|
||||
i.<caret>newFun()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p2, p1, handler)'" "true"
|
||||
|
||||
interface I {
|
||||
@deprecated("", ReplaceWith("newFun(p2, p1, handler)"))
|
||||
fun oldFun(p1: String = "", p2: Int = 0, handler: () -> Unit)
|
||||
|
||||
fun newFun(a: Int = 0, b: String = "", handler: () -> Unit)
|
||||
}
|
||||
|
||||
fun foo(i: I) {
|
||||
i.<caret>oldFun { }
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun(p2, p1, handler)'" "true"
|
||||
|
||||
interface I {
|
||||
@deprecated("", ReplaceWith("newFun(p2, p1, handler)"))
|
||||
fun oldFun(p1: String = "", p2: Int = 0, handler: () -> Unit)
|
||||
|
||||
fun newFun(a: Int = 0, b: String = "", handler: () -> Unit)
|
||||
}
|
||||
|
||||
fun foo(i: I) {
|
||||
i.<caret>newFun { }
|
||||
}
|
||||
Reference in New Issue
Block a user