mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
15 lines
315 B
Kotlin
Vendored
15 lines
315 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND: JVM_IR
|
|
// WITH_RUNTIME
|
|
// FILE: test.kt
|
|
inline class A(val s: String) {
|
|
fun fromResult(x: Result<String>) =
|
|
x.getOrNull() ?: s
|
|
}
|
|
|
|
fun box(): String {
|
|
return A("Fail").fromResult(Result.success("OK"))
|
|
}
|
|
|
|
// @TestKt.class:
|
|
// 1 INVOKESTATIC A.fromResult |