FIR: Rework bare types support

^KT-48305 Fixed
This commit is contained in:
Denis.Zharkov
2021-08-26 18:13:55 +03:00
committed by TeamCityServer
parent 587146679d
commit 112af9b145
21 changed files with 253 additions and 93 deletions
@@ -3,6 +3,6 @@
class G<T>
fun foo(p: <!UNRESOLVED_REFERENCE!>P<!>) {
val v = p as G?
checkSubtype<G<*>>(<!ARGUMENT_TYPE_MISMATCH!>v!!<!>)
val v = p as <!NO_TYPE_ARGUMENTS_ON_RHS!>G?<!>
checkSubtype<G<*>>(v!!)
}
@@ -0,0 +1,17 @@
// FIR_IDENTICAL
// SKIP_TXT
abstract class Parent<K>
abstract class DefaultParent<K, X> : Parent<K>()
abstract class TableDerived<K : A> : DefaultParent<K, Int>() {
fun bar(): K = TODO()
}
interface A {}
interface B : A { fun b() }
fun foo(): Parent<out B> = TODO()
fun main() {
val w = foo() as? TableDerived ?: return
w.bar().b()
}