[JS IR] IC: test private declarations with same names

This commit is contained in:
Anton Bannykh
2021-12-08 11:08:06 +03:00
parent 9b47a321d5
commit 670572bbc6
3 changed files with 36 additions and 0 deletions
@@ -4138,6 +4138,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/incremental/catchScope.kt");
}
@Test
@TestMetadata("clashingPrivateDeclarations.kt")
public void testClashingPrivateDeclarations() throws Exception {
runTest("js/js.translator/testData/box/incremental/clashingPrivateDeclarations.kt");
}
@Test
@TestMetadata("classReferencingClass.kt")
public void testClassReferencingClass() throws Exception {
@@ -4510,6 +4510,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/incremental/catchScope.kt");
}
@Test
@TestMetadata("clashingPrivateDeclarations.kt")
public void testClashingPrivateDeclarations() throws Exception {
runTest("js/js.translator/testData/box/incremental/clashingPrivateDeclarations.kt");
}
@Test
@TestMetadata("classReferencingClass.kt")
public void testClassReferencingClass() throws Exception {
@@ -0,0 +1,24 @@
// MODULE: lib
// FILE: lib.kt
private fun ok() = "Lib"
fun testLib() = ok()
// MODULE: main(lib)
// FILE: mainAux.kt
// RECOMPILE
private fun ok() = "Aux"
fun testAux() = ok()
// FILE: main.kt
private fun ok() = "OK"
fun box(): String {
if (testLib() != "Lib") return "fail1"
if (testAux() != "Aux") return "fail2"
return ok()
}