[FIR] KT-56612: Fully-expand types when casting bare types

^KT-56612 Fixed

Merge-request: KT-MR-8849
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
This commit is contained in:
Nikolay Lunyak
2023-02-17 09:15:59 +00:00
committed by Space Team
parent 0963bd25a8
commit 516efe77c9
13 changed files with 163 additions and 10 deletions
@@ -0,0 +1,16 @@
FILE: main.kt
public abstract interface KotlinCancellablePromise<E> : R|Promise<E>| {
}
public final class D<T> : R|kotlin/Any| {
public constructor<T>(): R|D<T>| {
super<R|kotlin/Any|>()
}
public final fun foo(x: R|Promise<T & Any>|): R|kotlin/Unit| {
this@R|/D|.R|/D.bar|((R|<local>/x| as R|KotlinCancellablePromise<T & Any>|))
}
public final fun bar(x: R|KotlinCancellablePromise<T & Any>|): R|kotlin/Unit| {
}
}
@@ -0,0 +1,17 @@
// FIR_IDENTICAL
// SKIP_TXT
// FILE: Promise.java
public interface Promise<T> {}
// FILE: main.kt
interface KotlinCancellablePromise<E> : Promise<E>
class D<T> {
fun foo(x: Promise<T & Any>) {
bar(x as KotlinCancellablePromise)
}
fun bar(x: KotlinCancellablePromise<T & Any>) {}
}