JvmDefault. Allow non default inheritance with special flag

#KT-47000
This commit is contained in:
Mikhael Bogdanov
2021-10-30 15:00:15 +02:00
parent c9e7c5d156
commit afc149d460
24 changed files with 461 additions and 6 deletions
@@ -0,0 +1,26 @@
// CHECK_BYTECODE_LISTING
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// JVM_TARGET: 1.8
// WITH_RUNTIME
// MODULE: lib
// !JVM_DEFAULT_MODE: all
// FILE: Foo.kt
interface Foo<T> {
fun foo(p: T) = p
}
// MODULE: main(lib)
// !JVM_DEFAULT_MODE: disable
// !JVM_DEFAULT_ALLOW_NON_DEFAULT_INHERITANCE
// FILE: main.kt
interface DerivedInterface<T> : Foo<T>
class DerivedClass : DerivedInterface<String> {
override fun foo(p: String) = super.foo(p)
}
fun box(): String {
return DerivedClass().foo("OK")
}