Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
0c8f3faeecbeecb0d1430ef2b86dd192a029711c
/
.
/
compiler
/
testData
/
codegen
/
box
/
inlineClasses
/
unboxValueOfNullableInlineClassUsingInlineFunction.kt
blob: 0140e98d3ba126c52f98ac5fc0afaa840908dea4 [
file
]
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
inline
class
X
(
val i
:
Int
)
fun unbox
(
x
:
X
?):
Int
=
checkNotNull
(
x
).
i
fun box
():
String
=
if
(
unbox
(
X
(
42
))
==
42
)
"OK"
else
"Fail"