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,10 @@
expect open class A<T>() {
open fun foo(arg: T)
}
open class B : A<String>() {
// Fake: override fun foo(arg: String) = super.foo(arg)
// Fake (JVM only) (?): override fun bar(arg: String): String = super.bar(arg)
}
open class C : B() {
open fun bar(arg: CharSequence): String = arg.toString()
}
@@ -0,0 +1,19 @@
FILE: common.kt
<T> public open expect class A {
public constructor(): super<R|kotlin/Any|>()
public open function foo(arg: R|T|): R|kotlin/Unit|
}
public open class B : R|A<kotlin/String>| {
public constructor(): super<R|A<kotlin/String>|>()
}
public open class C : R|B| {
public constructor(): super<R|B|>()
public open function bar(arg: R|kotlin/CharSequence|): R|kotlin/String| {
return@@@bar <Unresolved name: arg>#.<Unresolved name: toString>#()
}
}