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:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user