mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
17 lines
319 B
Kotlin
Vendored
17 lines
319 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND: JVM_IR
|
|
|
|
inline class Foo(val x: Int) : Comparable<Foo> {
|
|
override fun compareTo(other: Foo): Int {
|
|
return 10
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val f1 = Foo(42)
|
|
val ff1: Comparable<Foo> = f1
|
|
|
|
if (ff1.compareTo(f1) != 10) return "Fail"
|
|
|
|
return "OK"
|
|
} |