Fix for KT-5150: Accessors for private methods are not generated for get/set conventions

#KT-5150 Fixed
This commit is contained in:
Michael Bogdanov
2015-11-05 12:34:21 +03:00
parent 0fcaaa80df
commit bd2b01ac1c
4 changed files with 41 additions and 7 deletions
@@ -0,0 +1,21 @@
var result = "fail"
private operator fun X.get(name: String) = name + "K"
private operator fun X.set(name: String, v: String) {
result = v
}
class X {
fun test() : String {
if (this["O"] != "OK") return "fail 1: ${this["O"]}"
this["O"] += "K"
if (result != "OKK") return "fail 2: ${result}"
return "OK"
}
}
fun box(): String {
return X().test()
}