Extract property: do not add unnecessary extension receiver

#KT-24615 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-10-11 15:13:22 +09:00
committed by igoriakovlev
parent 0fe5694cb7
commit 4b5f3b7a94
4 changed files with 32 additions and 0 deletions
@@ -0,0 +1,9 @@
// EXTRACTION_TARGET: property with getter
open class Base(protected val i: Int)
class Impl(i: Int) : Base(i) {
fun foo(): Int {
return <selection>2 + 3 + i</selection>
}
}
@@ -0,0 +1,12 @@
// EXTRACTION_TARGET: property with getter
open class Base(protected val i: Int)
class Impl(i: Int) : Base(i) {
private val i: Int
get() = 2 + 3 + i
fun foo(): Int {
return i
}
}