Fix for KT-10715: Verify error on incrementing backing field from accessor

This commit is contained in:
Michael Bogdanov
2016-01-25 13:26:00 +03:00
parent cf09949354
commit 874560df9d
4 changed files with 29 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
fun box(): String {
var a = Base()
val count = a.count
if (count != 0) return "fail 1: $count"
val count2 = a.count
if (count2 != 1) return "fail 2: $count2"
return "OK"
}
class Base {
var count: Int = 0
get() = field++
}