// WITH_STDLIB // WORKS_WHEN_VALUE_CLASS // LANGUAGE: +ValueClasses, +GenericInlineClassParameter OPTIONAL_JVM_INLINE_ANNOTATION value class Z(val int: T) OPTIONAL_JVM_INLINE_ANNOTATION value class Str(val string: T) OPTIONAL_JVM_INLINE_ANNOTATION value class NStr(val string: T) fun fooZ(x: Z) = x fun fooStr(x: Str) = x fun fooNStr(x: NStr) = x fun box(): String { val fnZ: (Z) -> Z = ::fooZ if (fnZ.invoke(Z(42)).int != 42) throw AssertionError() val fnStr: (Str) -> Str = ::fooStr if (fnStr.invoke(Str("str")).string != "str") throw AssertionError() val fnNStr: (NStr) -> NStr = ::fooNStr if (fnNStr.invoke(NStr(null)).string != null) throw AssertionError() if (fnNStr.invoke(NStr("nstr")).string != "nstr") throw AssertionError() return "OK" }