Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/functionExpression.kt
T
2021-12-15 17:14:22 +00:00

12 lines
253 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
inline fun new(init: (Z) -> Unit): Z = Z(42)
OPTIONAL_JVM_INLINE_ANNOTATION
value class Z(val value: Int)
fun box(): String =
if (new(fun(z: Z) {}).value == 42) "OK" else "Fail"