Files
kotlin-fork/idea/testData/inspections/cleanup/cleanup.kt
T
Nikolay Krasko 1132652026 Update to 142.4245.2: Temprorary modify test data after IDEA update
The problem is in order of cleanup actions. Each action can invalidate psi and that can prevent next action from execution.
2015-09-02 15:10:43 +03:00

40 lines
643 B
Kotlin
Vendored

import pack.oldFun1
import pack.oldFun2 // should not be removed for non-deprecated overload used
import pack.oldFun3
trait Foo {
}
val f = { (a: Int, b: Int) -> a + b }
class A private()
val x = fun foo(x: String) { }
fun foo() {
@loop
for (i in 1..100) {
val v = oldFun2(i as Int)/* as Int*/
/* comment */
continue@loop
}
oldFun1(oldFun2(10))
oldFun2()
}
fun unnecessarySafeCall(x: String) {
x?.length()
}
fun unnecessaryExclExcl(x: String) {
x!!.length()
}
fun unnecessaryCast(x: String) = x as String
fun unnecessaryElvis(x: String) = x ?: ""
JavaAnn(1, "abc") class MyClass