[FIR] Report errors for upper bounded type variables by an empty intersection type

^KT-51221 Fixed
This commit is contained in:
Victor Petukhov
2022-02-11 12:25:06 +03:00
committed by teamcity
parent 65213e9a42
commit c16ae81a48
21 changed files with 206 additions and 26 deletions
@@ -0,0 +1,21 @@
// RENDER_DIAGNOSTICS_FULL_TEXT
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
class In<in T>
class Out<out T>
class A
class B
fun <K> select(x: K, y: K): K = x
fun <V> genericIn(x: In<V>) {}
fun <V> genericOut(x: Out<V>) {}
fun test1(a: In<A>, b: In<B>) {
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>genericIn<!>(select(a, b))
}
fun test2(a: Out<A>, b: Out<B>) {
genericOut(select(a, b))
}