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
34 lines
849 B
Kotlin
Vendored
34 lines
849 B
Kotlin
Vendored
// EXPECTED_REACHABLE_NODES: 1285
|
|
// CHECK_CALLED_IN_SCOPE: function=isType scope=box TARGET_BACKENDS=JS
|
|
// CHECK_CALLED_IN_SCOPE: function=isObject scope=box IGNORED_BACKENDS=JS
|
|
package foo
|
|
|
|
class A : Any()
|
|
|
|
fun Any?.asAny() = this
|
|
|
|
fun box(): String {
|
|
val x = Any().asAny()
|
|
if (x !is Any) return "fail1"
|
|
if (x.asDynamic().constructor !== js("Object")) return "fail1a"
|
|
|
|
if (A().asAny() !is Any) return "fail2"
|
|
|
|
if (arrayOf(1, 2, 3).asAny() !is Any) return "fail3"
|
|
|
|
if (createNakedObject() is Any) return "fail4"
|
|
|
|
if (({ }).asAny() !is Any) return "fail5"
|
|
|
|
if ((23).asAny() !is Any) return "fail6"
|
|
|
|
if ((3.14).asAny() !is Any) return "fail7"
|
|
|
|
if (false.asAny() !is Any) return "fail8"
|
|
|
|
if ("bar".asAny() !is Any) return "fail9"
|
|
|
|
return "OK"
|
|
}
|
|
|
|
fun createNakedObject(): Any? = js("Object.create(null)") |