mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
24 lines
464 B
Kotlin
Vendored
24 lines
464 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
|
|
interface IBase {
|
|
fun foo() = "BAD"
|
|
}
|
|
|
|
interface IFoo : IBase {
|
|
override fun foo() = "OK"
|
|
}
|
|
|
|
inline class Z(val x: Int) : IFoo
|
|
|
|
inline class L(val x: Long) : IFoo
|
|
|
|
inline class S(val x: String) : IFoo
|
|
|
|
fun box(): String {
|
|
if (Z(42).foo() != "OK") throw AssertionError()
|
|
if (L(4L).foo() != "OK") throw AssertionError()
|
|
if (S("").foo() != "OK") throw AssertionError()
|
|
|
|
return "OK"
|
|
} |