Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/kt37998Generic.kt
T
2022-02-15 08:11:13 +01:00

18 lines
333 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
OPTIONAL_JVM_INLINE_ANNOTATION
value class Z<T: Int>(val x: T)
class A {
fun foo() = Z(42)
}
fun test(a: A?) = a?.foo()!!
fun box(): String {
val t = test(A())
if (t.x != 42) throw AssertionError("$t")
return "OK"
}