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

14 lines
308 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
OPTIONAL_JVM_INLINE_ANNOTATION
value class Z<T: Int>(val x: T) {
constructor(x: Long = 42L) : this(x.toInt() as T)
}
fun box(): String {
if (Z<Int>().x != 42) throw AssertionError()
return "OK"
}