Fix compilation on mixed hierarchies in compatibility mode

This commit is contained in:
Mikhail Bogdanov
2020-06-19 15:54:23 +02:00
parent 41511898a1
commit af3bda51ec
6 changed files with 50 additions and 17 deletions
@@ -0,0 +1,27 @@
// FILE: 1.kt
// !JVM_DEFAULT_MODE: disable
interface Foo<T> {
fun test(p: T) = "fail"
val T.prop: String
get() = "fail"
}
// FILE: main.kt
// !JVM_DEFAULT_MODE: all-compatibility
// JVM_TARGET: 1.8
interface Foo2: Foo<String> {
override fun test(p: String) : String = p
override val String.prop: String
get() = this
}
interface Foo3: Foo<String>, Foo2
class Base : Foo3
fun box(): String {
val base = Base()
return base.test("O") + with(base) { "K".prop }
}