DeprecatedSymbolUsageFix: dealing with dropping arguments with potential side effects + stdlib's "let" has no receiver type bound
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(bar())
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
bar()
|
||||
<caret>newFun()
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
getC().<caret>oldFun()
|
||||
}
|
||||
|
||||
fun getC(): C = C()
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
getC()
|
||||
<caret>newFun()
|
||||
}
|
||||
|
||||
fun getC(): C = C()
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
fun newFun(): Int = 0
|
||||
|
||||
fun foo(): Int {
|
||||
return <caret>oldFun(bar())
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
fun newFun(): Int = 0
|
||||
|
||||
fun foo(): Int {
|
||||
return bar().let { newFun() }
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
fun newFun(): Int = 0
|
||||
|
||||
fun foo(): Int = <caret>oldFun(bar())
|
||||
|
||||
fun bar(): Int? = 0
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun()
|
||||
}
|
||||
|
||||
fun newFun(): Int = 0
|
||||
|
||||
fun foo(): Int = bar().<caret>let { newFun() }
|
||||
|
||||
fun bar(): Int? = 0
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p2)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p2)"))
|
||||
fun oldFun(p1: Int, p2: Int): Boolean {
|
||||
return newFun(p2)
|
||||
}
|
||||
|
||||
fun newFun(p: Int) = false
|
||||
|
||||
fun foo(list: List<Int>) {
|
||||
list.filter { !<caret>oldFun(bar(), it) }
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p2)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p2)"))
|
||||
fun oldFun(p1: Int, p2: Int): Boolean {
|
||||
return newFun(p2)
|
||||
}
|
||||
|
||||
fun newFun(p: Int) = false
|
||||
|
||||
fun foo(list: List<Int>) {
|
||||
list.filter { !bar().let { p1 -> newFun(it) } }
|
||||
}
|
||||
|
||||
fun bar(): Int = 0
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
getC()?.<caret>oldFun()
|
||||
}
|
||||
|
||||
fun getC(): C? = null
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun() {
|
||||
newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
<caret>if (getC() != null) {
|
||||
newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun getC(): C? = null
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(): Int {
|
||||
return newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun newFun(): Int = 0
|
||||
|
||||
fun foo(): Int? {
|
||||
return getC()?.<caret>oldFun()
|
||||
}
|
||||
|
||||
fun getC(): C? = null
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class C {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(): Int {
|
||||
return newFun()
|
||||
}
|
||||
}
|
||||
|
||||
fun newFun(): Int = 0
|
||||
|
||||
fun foo(): Int? {
|
||||
return getC()?.<caret>let { newFun() }
|
||||
}
|
||||
|
||||
fun getC(): C? = null
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun(p, p)
|
||||
}
|
||||
|
||||
fun newFun(p1: Int?, p2: Int?): Int = 0
|
||||
|
||||
fun foo(): Int {
|
||||
return <caret>oldFun(bar())
|
||||
}
|
||||
|
||||
fun bar(): Int? = null
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun(p, p)'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun(p, p)"))
|
||||
fun oldFun(p: Int?): Int {
|
||||
return newFun(p, p)
|
||||
}
|
||||
|
||||
fun newFun(p1: Int?, p2: Int?): Int = 0
|
||||
|
||||
fun foo(): Int {
|
||||
return bar().let { newFun(it, it) }
|
||||
}
|
||||
|
||||
fun bar(): Int? = null
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(O.x + 1)
|
||||
}
|
||||
|
||||
object O {
|
||||
var x = 0
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(p: Int) {
|
||||
newFun()
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo() {
|
||||
<caret>newFun()
|
||||
}
|
||||
|
||||
object O {
|
||||
var x = 0
|
||||
}
|
||||
Reference in New Issue
Block a user