[FIR JS] Report rtti-related diagnostics

This commit is contained in:
Nikolay Lunyak
2023-01-26 10:52:33 +02:00
parent 351588f0a7
commit 2b5d2dc539
18 changed files with 159 additions and 25 deletions
@@ -1,5 +0,0 @@
external interface I
fun box(a: Any, b: Any): Pair<I, I?> {
return Pair(a as I, b as? I)
}
@@ -1,3 +1,6 @@
// FIR_IDENTICAL
// DIAGNOSTICS: +UNCHECKED_CAST_TO_EXTERNAL_INTERFACE
external interface I
fun box(a: Any, b: Any): Pair<I, I?> {
@@ -1,5 +0,0 @@
external interface I
fun box(a: Any, b: Any): Boolean {
return a is I && b !is I
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
external interface I
fun box(a: Any, b: Any): Boolean {
@@ -1,5 +0,0 @@
external interface I
fun box() {
println(I::class)
}
@@ -1,5 +1,8 @@
// FIR_IDENTICAL
external interface I
typealias TA = I
fun box() {
println(<!EXTERNAL_INTERFACE_AS_CLASS_LITERAL!>I::class<!>)
println(<!EXTERNAL_INTERFACE_AS_CLASS_LITERAL!>TA::class<!>)
}
@@ -7,3 +7,5 @@ public external interface I {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public typealias TA = I
@@ -1,9 +0,0 @@
external interface I
external interface J
fun box(a: Any) = when (a) {
is I -> 0
!is J -> 1
else -> 2
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
external interface I
external interface J