002d62de89
[JS IR] Fix line number test [JS IR] Ignore isInstance repl test [JS IR] Ignore isInstance repl test [JS IR] Add test with unsafe variance Revert "[JS IR] Optimize away upcasts" This reverts commit8149189585. Get rid of duplicated signatures Revert "[JS IR] Consider erasing type parameters in return type in js signatures" This reverts commit6adcbe081e. Revert "rra/ilgonmic/exported-bridges-2 [JS IR] Use js name for signature" This reverts commit00289d35[JS IR] Leave as is [JS IR] Add test with overloading by generic [JS IR] Add test from master [JS IR] Add tests from master Merge-request: KT-MR-5987 Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com> ^KT-51700 fixed ^KT-51523 fixed ^KT-51685 fixed
24 lines
787 B
Kotlin
Vendored
24 lines
787 B
Kotlin
Vendored
// EXPECTED_REACHABLE_NODES: 1286
|
|
package foo
|
|
|
|
// CHECK_NOT_CALLED: isTypeOfOrNull
|
|
// CHECK_NULLS_COUNT: function=box count=10 TARGET_BACKENDS=JS
|
|
// CHECK_NULLS_COUNT: function=box count=6 IGNORED_BACKENDS=JS
|
|
|
|
inline
|
|
fun <reified T> Any?.isTypeOfOrNull() = this is T?
|
|
|
|
class A
|
|
class B
|
|
|
|
fun box(): String {
|
|
assertEquals(true, null.isTypeOfOrNull<A>(), "null.isTypeOfOrNull<A>()")
|
|
assertEquals(true, null.isTypeOfOrNull<A?>(), "null.isTypeOfOrNull<A?>()")
|
|
assertEquals(true, A().isTypeOfOrNull<A>(), "A().isTypeOfOrNull<A>()")
|
|
assertEquals(true, A().isTypeOfOrNull<A?>(), "A().isTypeOfOrNull<A?>()")
|
|
assertEquals(false, A().isTypeOfOrNull<B>(), "A().isTypeOfOrNull<B>()")
|
|
assertEquals(false, A().isTypeOfOrNull<B?>(), "A().isTypeOfOrNull<B?>()")
|
|
|
|
return "OK"
|
|
}
|