[FIR] Fix crash caused by cast of raw type to simple type

#KT-66552 Fixed
This commit is contained in:
Kirill Rakhman
2024-03-13 13:56:12 +01:00
committed by Space Team
parent cec36355b2
commit 786c37286c
7 changed files with 74 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
// FIR_IDENTICAL
// ISSUE: KT-66552
// FILE: JsStubElementType.java
public interface JsStubElementType<E, S extends JsStubElement<E>> {}
// FILE: JsStubElement.java
public interface JsStubElement<T> {
<E, S extends JsStubElement<E>> void findChildStubByType(JsStubElementType<E, S> childStubType);
}
// FILE: FromJava.java
public interface FromJava {
JsStubElement RAW_TYPED_STUB = null;
}
// FILE: Kotlin.kt
interface JsStubElementSubType: JsStubElement<Any>
fun test(childStubType: JsStubElementType<Any, JsStubElement<Any>>) {
val rawTypedStub = FromJava.RAW_TYPED_STUB
if (rawTypedStub is JsStubElementSubType) {
rawTypedStub.findChildStubByType(childStubType)
}
}