Fix nullability propagation in inline class type mapping

#KT-27096

See https://jetbrains.slack.com/archives/C06E082M6/p1537949572000100
This commit is contained in:
Dmitry Petrov
2018-09-26 12:05:09 +03:00
parent 0b23ddb947
commit ab90b2b901
20 changed files with 843 additions and 15 deletions
@@ -0,0 +1,18 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
inline class Z1(val x: String)
inline class ZN(val z: Z1?)
inline class ZN2(val z: ZN)
fun zap(b: Boolean): ZN2? = if (b) null else ZN2(ZN(null))
fun eq(a: Any?, b: Any?) = a == b
fun box(): String {
val x = zap(true)
val y = zap(false)
if (eq(x, y)) throw AssertionError()
return "OK"
}