DeprecatedSymbolUsageFix: more correct generation of "let" for safe call

This commit is contained in:
Valentin Kipyatkov
2015-05-18 20:41:56 +03:00
parent df850d7035
commit 348d09866a
11 changed files with 203 additions and 8 deletions
@@ -0,0 +1,20 @@
// "Replace with 'c1.newFun(this, c2)'" "true"
class X {
@deprecated("", ReplaceWith("c1.newFun(this, c2)"))
fun oldFun(c1: Char, c2: Char): Char = c1.newFun(this, c2)
val c: Char = 'a'
}
fun Char.newFun(x: X, c: Char): Char = this
fun foo(s: String, x: X) {
val chars = s.filter {
O.x?.<caret>oldFun(it, x.c) != 'a'
}
}
object O {
var x: X? = null
}