Files
kotlin/compiler/testData/codegen/box/inlineClasses/nullableWrapperEquality.kt
Mark Punzalan 802beb49a6 Use TypeSubstitutor to get the substituted underlying type for inline
classes, instead of MemberScope.

The primary motivation was to fix issues around type-mapping for inline
classes in FIR, which uses wrapped descriptors that have empty
MemberScopes.
2020-06-04 17:03:55 +03:00

17 lines
337 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
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"
}