mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
15 lines
245 B
Kotlin
Vendored
15 lines
245 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND: JVM_IR
|
|
|
|
inline class Foo(val x: Int) {
|
|
inline fun inc(): Foo = Foo(x + 1)
|
|
}
|
|
|
|
fun box(): String {
|
|
val a = Foo(0)
|
|
val b = a.inc().inc()
|
|
|
|
if (b.x != 2) return "fail"
|
|
|
|
return "OK"
|
|
} |