KT-4340: Jvm backend generates invalid synthetic accessor for private extension property

This commit is contained in:
Mikhael Bogdanov
2014-04-01 10:37:16 +04:00
parent 33b1813dd7
commit 596dc68ea4
3 changed files with 49 additions and 2 deletions
@@ -0,0 +1,36 @@
class A {
var result: Int = 0;
private val Int.times3: Int
get() = this * 3
private var Int.times: Int
get() = this * 4
set(s: Int) {
result = this * s
}
fun test(p: Int):Int {
return {
p.times3
}()
}
fun test2(p: Int, s: Int):Int {
{
p.times = s
}()
return result
}
}
fun box() : String {
var result = A().test(3);
if (result != 9) return "fail1: $result"
result = A().test2(2, 4);
if (result != 8) return "fail2: $result"
return "OK"
}