Add multiplatform test with substitution, fix deep supertypes

This commit fixes ambiguity problems introduced before
in MPP tests with deep supertypes

#KT-29636 Fixed
This commit is contained in:
Simon Ogorodnik
2019-01-31 22:04:31 +03:00
committed by Mikhail Glukhikh
parent 0e3fecf614
commit bd769f8fd7
14 changed files with 147 additions and 15 deletions
@@ -0,0 +1,11 @@
actual open class A<T> {
actual open fun foo(arg: T) {}
open fun bar(arg: T): T = arg
}
class D : C() {
// Fake: override fun bar(arg: CharSequence): String = super.bar(arg)
fun test() {
foo("")
bar("")
}
}
@@ -0,0 +1,21 @@
FILE: jvm.kt
<T> public open actual class A {
public constructor(): super<R|kotlin/Any|>()
public open actual function foo(arg: R|T|): R|kotlin/Unit| {
}
public open function bar(arg: R|T|): R|T| {
return@@@bar <Unresolved name: arg>#
}
}
public final class D : R|C| {
public constructor(): super<R|C|>()
public final function test(): R|kotlin/Unit| {
R|FakeOverride</A.foo>|(String())
R|FakeOverride</A.bar>|(String())
}
}