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:
Dmitry Petrov
2018-09-24 12:33:51 +03:00
parent c1bb3479df
commit edc8cf3ed0
8 changed files with 76 additions and 3 deletions
@@ -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()
@@ -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()