Approximate captured type before mapping

#KT-7415 Fixed
This commit is contained in:
Denis Zharkov
2016-01-27 14:39:35 +03:00
parent 5b0fdcb3fe
commit 36f21932bb
4 changed files with 32 additions and 19 deletions
@@ -0,0 +1,21 @@
// Basically this test checks that no captured type used as argument for signature mapping
class SwOperator<T>: Operator<List<T>, T>
interface Operator<R, T>
open class Inv<T>
class Obs<Y> {
inline fun <reified X> lift(lift: Operator<out X, in Y>) = object : Inv<X>() {}
}
fun box(): String {
val o: Obs<CharSequence> = Obs()
val inv = o.lift(SwOperator())
val signature = inv.javaClass.genericSuperclass.toString()
if (signature != "Inv<java.util.List<?>>") return "fail 1: $signature"
return "OK"
}