mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
17 lines
228 B
Kotlin
17 lines
228 B
Kotlin
open class Base {
|
|
val pr : String = "OK"
|
|
}
|
|
|
|
trait Trait : Base {
|
|
fun f() : String {
|
|
return this.pr
|
|
}
|
|
}
|
|
|
|
class A : Trait, Base() {
|
|
|
|
}
|
|
|
|
fun box() : String {
|
|
return if (A().f() == A().pr) "OK" else "fail"
|
|
} |