[FIR] Implement REIFIED_TYPE_FORBIDDEN_SUBSTITUTION

This commit is contained in:
Ivan Kochurkin
2021-07-15 15:29:41 +03:00
committed by teamcityserver
parent bade6cb611
commit 173813f7cf
14 changed files with 59 additions and 23 deletions
@@ -11,5 +11,5 @@ fun test1() {
val f2: Foo<in Nothing> = foo1 { it checkType { _<Nothing>() } }
val f3: Foo<out Int> = foo2 { it checkType { _<Int>() } }
val f4: Foo<in Nothing> = foo2 { it checkType { _<Nothing>() } }
}
val f4: Foo<in Nothing> = <!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>foo2<!> { it checkType { _<Nothing>() } }
}
@@ -22,7 +22,7 @@ fun test2() {
}
fun test3() {
takeReifiedUnbound(null)
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>takeReifiedUnbound<!>(null)
}
fun test4(): Bound = takeReifiedUnbound(null)
@@ -35,7 +35,7 @@ fun test5(): Bound? = select(
fun test6() {
select(
null,
materializeReified()
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>materializeReified<!>()
)
}
@@ -48,6 +48,6 @@ fun test7(): Bound? =
fun test8() {
select(
null,
materializeReifiedUnbound()
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>materializeReifiedUnbound<!>()
)
}
@@ -28,7 +28,7 @@ inline fun <reified T : In<T>> testIn(): T {
// Unexpected behaviour
inline fun <reified T : Out<T>> testOut(): T {
return try {
outBound()
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>outBound<!>()
} catch (ex: Exception) {
throw Exception()
}