Extract property: do not suggest duplicate property name

#KT-36504 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-02-12 05:28:44 +01:00
committed by Vladimir Dolzhenko
parent dc949658d6
commit a96cafe066
5 changed files with 43 additions and 6 deletions
@@ -0,0 +1,8 @@
// EXTRACTION_TARGET: property with initializer
open class Base(protected val i: Int)
class Impl(z: Int) : Base(z) {
fun foo(): Int {
return <selection>2 + 3 + i</selection>
}
}
@@ -0,0 +1,10 @@
// EXTRACTION_TARGET: property with initializer
open class Base(protected val i: Int)
class Impl(z: Int) : Base(z) {
private val i1 = 2 + 3 + i
fun foo(): Int {
return i1
}
}
@@ -3,10 +3,10 @@
open class Base(protected val i: Int)
class Impl(i: Int) : Base(i) {
private val i: Int
private val i1: Int
get() = 2 + 3 + i
fun foo(): Int {
return i
return i1
}
}