Add test case to detect name clash in stdlib-js
This commit is contained in:
committed by
Roman Artemev
parent
689a492b9a
commit
06009a532b
+5
@@ -1809,6 +1809,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/expression/cast/castToNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("checkThrowCCE.kt")
|
||||
public void testCheckThrowCCE() throws Exception {
|
||||
runTest("js/js.translator/testData/box/expression/cast/checkThrowCCE.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("explicitUpcast.kt")
|
||||
public void testExplicitUpcast() throws Exception {
|
||||
runTest("js/js.translator/testData/box/expression/cast/explicitUpcast.kt");
|
||||
|
||||
+5
@@ -1809,6 +1809,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/expression/cast/castToNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("checkThrowCCE.kt")
|
||||
public void testCheckThrowCCE() throws Exception {
|
||||
runTest("js/js.translator/testData/box/expression/cast/checkThrowCCE.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("explicitUpcast.kt")
|
||||
public void testExplicitUpcast() throws Exception {
|
||||
runTest("js/js.translator/testData/box/expression/cast/explicitUpcast.kt");
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// EXPECTED_REACHABLE_NODES: 1094
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
"fail".unsafeCast<KClass<*>>().js
|
||||
return "fail try"
|
||||
} catch (cce: ClassCastException) {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
return "fail common"
|
||||
}
|
||||
Reference in New Issue
Block a user