Code cleanup to remove deprecated symbol imports that have ReplaceWith

This commit is contained in:
Valentin Kipyatkov
2015-08-28 21:37:56 +03:00
parent c020189ad0
commit e98edbcbac
9 changed files with 76 additions and 38 deletions
+6
View File
@@ -1,3 +1,7 @@
import pack.oldFun1
import pack.oldFun2 // should not be removed for non-deprecated overload used
import pack.oldFun3
trait Foo {
}
@@ -16,6 +20,8 @@ fun foo() {
}
oldFun1(oldFun2(10))
oldFun2()
}
fun unnecessarySafeCall(x: String) {
+5
View File
@@ -1,3 +1,6 @@
import pack.bar
import pack.oldFun2 // should not be removed for non-deprecated overload used
interface Foo {
}
@@ -16,6 +19,8 @@ fun foo() {
}
bar(bar(10 + 2) + 1)
oldFun2()
}
fun unnecessarySafeCall(x: String) {
+10
View File
@@ -1,7 +1,17 @@
package pack
@deprecated("", ReplaceWith("bar(p + 1)"))
public fun oldFun1(p: Int): Int = 0
@deprecated("", ReplaceWith("bar(-1)"))
public fun oldFun1(): Int = 0
@deprecated("", ReplaceWith("bar(p + 2)"))
public fun oldFun2(p: Int): Int = 0
public fun oldFun2(): Int = 0
@deprecated("", ReplaceWith("bar(p)"))
public fun oldFun3(p: Int): Int = 0
public fun bar(p: Int): Int = p