Inline Property supported for properties with setter

#KT-2638 Fixed
This commit is contained in:
Valentin Kipyatkov
2017-05-23 15:26:04 +03:00
parent e6bfa55534
commit ab1b985bac
16 changed files with 181 additions and 66 deletions
@@ -0,0 +1,8 @@
class A {
var property = 10
private set
fun f() {
println(<caret>property)
}
}
@@ -0,0 +1,6 @@
class A {
fun f() {
println(10)
}
}
@@ -0,0 +1,10 @@
var Int.<caret>property: Int
get() = this
set(value) {
println("Set value of $value for $this")
}
fun foo() {
println(1.property)
2.property = 10
}
@@ -0,0 +1,4 @@
fun foo() {
println(1)
println("Set value of ${10} for ${2}")
}
@@ -0,0 +1,10 @@
// ERROR: The following usages are not supported by the Inline refactoring. They won't be processed.\nUnsupported usage: property++
var <caret>property: Int
get() = 1
set(value) {
}
fun foo() {
property++
}