Prohibit nested intersection types in return position

#KT-11490 Fixed
This commit is contained in:
Denis Zharkov
2016-03-18 11:16:06 +03:00
parent 90b5d3b9f5
commit 67b59fa72f
4 changed files with 41 additions and 1 deletions
@@ -0,0 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
interface In<in E>
open class A : In<A>
open class B : In<B>
fun <T> select(x: T, y: T) = x
fun <!IMPLICIT_INTERSECTION_TYPE!>foo2<!>() = select(A(), B()) // Type is In<A & B> is prohibited in return position