Fix common supertype calculation
Use star-projections instead of 'out Any?' in corner cases #KT-11468 Fixed
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user