Add a test to reveal flaw in call delegation with default implementations in interfaces.
This commit is contained in:
committed by
max-kammerer
parent
5cefd4e443
commit
cc6252098f
+16
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user