[FIR] Support determining emptiness of an intersection type with type parameters' types

This commit is contained in:
Victor Petukhov
2022-04-05 17:19:06 +03:00
committed by teamcity
parent 313da6f41e
commit 47d6236a2d
97 changed files with 1970 additions and 106 deletions
@@ -0,0 +1,7 @@
fun <T : <!FINAL_UPPER_BOUND!>String<!>> g(): T? = null
fun <R> f(block: () -> R?): R? = block()
fun main() {
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>f<!><Int> { g() /* OK, g() is inferred into {Int & String}? */ }
}
@@ -0,0 +1,7 @@
fun <T : <!FINAL_UPPER_BOUND!>String<!>> g(): T? = null
fun <R> f(block: () -> R?): R? = block()
fun main() {
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>f<!><Int> { g() /* OK, g() is inferred into {Int & String}? */ }
}
@@ -0,0 +1,5 @@
package
public fun </*0*/ R> f(/*0*/ block: () -> R?): R?
public fun </*0*/ T : kotlin.String> g(): T?
public fun main(): kotlin.Unit