[FIR] Unify code of type unification, fix intersection types processing in FirCastDiagnosticsHelpers.kt

This commit is contained in:
Ivan Kochurkin
2021-11-10 14:52:07 +03:00
committed by TeamCityServer
parent 98cce8e05b
commit 5fda933c33
7 changed files with 214 additions and 330 deletions
@@ -1,6 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-10444 Do not ignore smart (unchecked) casts to the same classifier
class Base<in T>
class Qwe<T : Any>(val a: T?) {
fun test1(obj: Any) {
obj <!UNCHECKED_CAST!>as Qwe<T><!>
@@ -12,6 +13,10 @@ class Qwe<T : Any>(val a: T?) {
check(obj.a)
}
fun test2(b: Base<*>) {
b <!UNCHECKED_CAST!>as Base<Any><!>
}
fun check(a: T?) {
}
}