mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
8 lines
137 B
Kotlin
8 lines
137 B
Kotlin
trait A {
|
|
fun foo(x: Int, y: Int = x + 20, z: Int = y * 2) = z
|
|
}
|
|
|
|
class B : A {}
|
|
|
|
fun box() = if (B().foo(1) == 42) "OK" else "Fail"
|