20 lines
462 B
Kotlin
Vendored
20 lines
462 B
Kotlin
Vendored
// WITH_STDLIB
|
|
// WORKS_WHEN_VALUE_CLASS
|
|
// LANGUAGE: +ValueClasses
|
|
|
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
|
value class Z(val x: Int)
|
|
|
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
|
value class L(val x: Long)
|
|
|
|
OPTIONAL_JVM_INLINE_ANNOTATION
|
|
value class S(val x: String)
|
|
|
|
fun box(): String {
|
|
if (Z(42)::x.get() != 42) throw AssertionError()
|
|
if (L(1234L)::x.get() != 1234L) throw AssertionError()
|
|
if (S("abcdef")::x.get() != "abcdef") throw AssertionError()
|
|
|
|
return "OK"
|
|
} |