mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
- report errors on implementing methods of Any in interfaces - update testData ~~~ Java 8 override restrictions: interface can't implement a method of 'Any' - update compiler sources
16 lines
286 B
Kotlin
Vendored
16 lines
286 B
Kotlin
Vendored
interface Trait {
|
|
fun foo() = "O"
|
|
fun bar(): String
|
|
}
|
|
|
|
class SimpleClass : Trait {
|
|
override fun bar() = "K"
|
|
}
|
|
|
|
// Delegating 'toString' doesn't work, see KT-9519
|
|
class ComplexClass : Trait by SimpleClass() {
|
|
fun qux() = foo() + bar()
|
|
}
|
|
|
|
fun box() = ComplexClass().qux()
|