Fix common supertype calculation

Use star-projections instead of 'out Any?' in corner cases

 #KT-11468 Fixed
This commit is contained in:
Denis Zharkov
2016-03-17 14:56:21 +03:00
parent bace881463
commit ce8add2802
9 changed files with 111 additions and 5 deletions
@@ -0,0 +1,11 @@
interface In<in E>
class En<T> : In<T>
class A : In<A>
fun <T> select(x: T, y: T): T = x ?: y
// This test just checks that no internal error happens in backend
// Return type should be In<*> nor In<out Any?>
fun foobar(e: En<*>) = select(A(), e)
fun box() = "OK"
@@ -0,0 +1,9 @@
interface In<in E>
class A : In<A>
class B : In<B>
fun <T> select(x: T, y: T) = x ?: y
// This test just checks that no internal error happens in backend
fun foobar(a: A, b: B) = select(a, b)
fun box() = "OK"