Fix for KT-6154: Inlining a private class function accessing a private val member throws exception at runtime in accessing the val getter

#KT-6154 Fixed
This commit is contained in:
Michael Bogdanov
2014-10-30 12:30:45 +03:00
parent 951ce827a6
commit 59917f3727
5 changed files with 46 additions and 1 deletions
@@ -0,0 +1,10 @@
import test.*
fun box() : String {
val p = P()
if (p.testPrivate() != "OK") return "fail 1 ${p.testPrivate()}"
if (p.testFinal() != "OK") return "fail 2 ${p.testFinal()}"
return "OK"
}
@@ -0,0 +1,23 @@
package test
class P {
private val FOO_PRIVATE = "OK"
final val FOO_FINAL = "OK"
private inline fun fooPrivate(): String {
return FOO_PRIVATE
}
private inline fun fooFinal(): String {
return FOO_FINAL
}
fun testPrivate(): String {
return fooPrivate()
}
fun testFinal(): String {
return fooFinal()
}
}