Files
kotlin-fork/idea/testData/refactoring/introduceProperty/extractLazyWithBlock.kt.after
T
2015-03-04 23:06:07 +03:00

21 lines
311 B
Plaintext

// WITH_RUNTIME
// EXTRACTION_TARGET: lazy property
import kotlin.properties.Delegates
class A(val n: Int = 1) {
val m: Int = 2
private val i: Int by Delegates.lazy {
println(n)
m + n + 1
}
fun foo(): Int {
return if (n > 1) {
i
} else 0
}
}