mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
17 lines
277 B
Kotlin
Vendored
17 lines
277 B
Kotlin
Vendored
interface I {
|
|
fun foo(x: Int = 23): String
|
|
}
|
|
|
|
abstract class Base : I
|
|
|
|
class C : Base(), I {
|
|
override fun foo(x: Int) = "C:$x"
|
|
}
|
|
|
|
fun box(): String {
|
|
val x: I = C()
|
|
val r = x.foo() + ";" + x.foo(42)
|
|
if (r != "C:23;C:42") return "fail: $r"
|
|
|
|
return "OK"
|
|
} |