Extract property: do not add unnecessary extension receiver
#KT-24615 Fixed
This commit is contained in:
committed by
igoriakovlev
parent
0fe5694cb7
commit
4b5f3b7a94
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user