KT-12152 : constructor consistency: distinguish properties with and w/o backing fields, with default / custom accessors

This commit is contained in:
Mikhail Glukhikh
2015-08-12 14:58:06 +03:00
parent 422ea4c6cb
commit be40cf8138
10 changed files with 148 additions and 18 deletions
@@ -0,0 +1,17 @@
class My(var x: String) {
var y: String
get() = if (x != "") x else z
set(arg) {
if (arg != "") x = arg
}
val z: String
init {
// Dangerous: setter!
<!DEBUG_INFO_LEAKING_THIS!>y<!> = "x"
// Dangerous: getter!
if (<!DEBUG_INFO_LEAKING_THIS!>y<!> != "") z = this.<!DEBUG_INFO_LEAKING_THIS!>y<!> else z = <!DEBUG_INFO_LEAKING_THIS!>y<!>
}
}