KT-27705: Use proper types for captured outer class instance

Call typeMapper only if we have an inline class.
This commit is contained in:
Dmitry Petrov
2018-10-19 16:48:18 +03:00
parent 60986293bf
commit ea4afdaebe
9 changed files with 70 additions and 9 deletions
+17
View File
@@ -0,0 +1,17 @@
// !LANGUAGE: +InlineClasses
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR
inline class Z(val x: Int) {
inner class Inner(val y: Int) {
val xx = x
}
}
fun box(): String {
val zi = Z(42).Inner(100)
if (zi.xx != 42) throw AssertionError()
if (zi.y != 100) throw AssertionError()
return "OK"
}