Extract property: do not suggest duplicate property name
#KT-36504 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
dc949658d6
commit
a96cafe066
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user