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,19 @@
class My {
val x: Int
get() = field + if (z != "") 1 else 0
val y: Int
get() = field - if (z == "") 0 else 1
val w: Int
init {
// Safe, val never has a setter
x = 0
this.y = 0
// Unsafe
w = this.<!DEBUG_INFO_LEAKING_THIS!>x<!> + <!DEBUG_INFO_LEAKING_THIS!>y<!>
}
val z = "1"
}