Fix for KT-10715: Verify error on incrementing backing field from accessor
This commit is contained in:
@@ -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++
|
||||
}
|
||||
Reference in New Issue
Block a user