fix(KT-50040): remove the corresponding symbol from top-level accessors.

This commit is contained in:
Artem Kobzar
2021-12-09 13:39:35 +00:00
committed by Space
parent 611c402e59
commit b1643075f2
4 changed files with 32 additions and 1 deletions
@@ -59,7 +59,6 @@ class PrivateMembersLowering(val context: JsIrBackendContext) : DeclarationTrans
visibility = newVisibility
}.also {
it.parent = function.parent
it.correspondingPropertySymbol = function.correspondingPropertySymbol
}
staticFunction.typeParameters += function.typeParameters.map { it.deepCopyWithSymbols(staticFunction) }
@@ -6256,6 +6256,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/jsExport/jsExportInClass.kt");
}
@Test
@TestMetadata("privatePropertyAccessFromMethod.kt")
public void testPrivatePropertyAccessFromMethod() throws Exception {
runTest("js/js.translator/testData/box/jsExport/privatePropertyAccessFromMethod.kt");
}
@Test
@TestMetadata("recursiveExport.kt")
public void testRecursiveExport() throws Exception {
@@ -6640,6 +6640,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/jsExport/jsExportInClass.kt");
}
@Test
@TestMetadata("privatePropertyAccessFromMethod.kt")
public void testPrivatePropertyAccessFromMethod() throws Exception {
runTest("js/js.translator/testData/box/jsExport/privatePropertyAccessFromMethod.kt");
}
@Test
@TestMetadata("recursiveExport.kt")
public void testRecursiveExport() throws Exception {
@@ -0,0 +1,20 @@
// EXPECTED_REACHABLE_NODES: 1286
// TARGET_BACKENDS=JS_IR
package foo
@JsExport
object A {
private val foo: Int
get() = 23
fun bar(): Int {
return foo
}
}
fun box(): String {
var result = A.bar()
if (result != 23) return "failed: ${result}"
return "OK"
}