Use proper type for context 'this'
Bug in 'generateThisOrOuterFromContext', it worked while instance of a class was always an object. #KT-27078
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class R(private val r: Int) {
|
||||
fun test() = { ok() }()
|
||||
|
||||
fun ok() = "OK"
|
||||
}
|
||||
|
||||
fun box() = R(0).test()
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class R(private val r: Int) {
|
||||
fun test() = object {
|
||||
override fun toString() = ok()
|
||||
}.toString()
|
||||
|
||||
fun ok() = "OK"
|
||||
}
|
||||
|
||||
fun box() = R(0).test()
|
||||
Reference in New Issue
Block a user