Add a test to reveal flaw in call delegation with default implementations in interfaces.

This commit is contained in:
Kristoffer Andersen
2019-09-25 15:25:22 +02:00
committed by max-kammerer
parent 5cefd4e443
commit cc6252098f
4 changed files with 31 additions and 0 deletions
@@ -0,0 +1,16 @@
// !JVM_DEFAULT_MODE: compatibility
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface A {
@JvmDefault
fun foo(x: String = "OK"): String {
return x
}
}
fun box(): String {
val x = object : A {}
return x.foo()
}