[K/JS] Fix private constructor delegating inside single class with ES6 mode ^KT-59335 Fixed
This commit is contained in:
@@ -4478,6 +4478,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/inheritance/definitionOrder.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatingToSecondaryCtor.kt")
|
||||
public void testDelegatingToSecondaryCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/inheritance/delegatingToSecondaryCtor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromFakeClasses.kt")
|
||||
public void testFromFakeClasses() throws Exception {
|
||||
|
||||
+6
@@ -5106,6 +5106,12 @@ public class FirJsBoxTestGenerated extends AbstractFirJsBoxTest {
|
||||
runTest("js/js.translator/testData/box/inheritance/definitionOrder.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatingToSecondaryCtor.kt")
|
||||
public void testDelegatingToSecondaryCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/inheritance/delegatingToSecondaryCtor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromFakeClasses.kt")
|
||||
public void testFromFakeClasses() throws Exception {
|
||||
|
||||
+6
@@ -5212,6 +5212,12 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test {
|
||||
runTest("js/js.translator/testData/box/inheritance/definitionOrder.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatingToSecondaryCtor.kt")
|
||||
public void testDelegatingToSecondaryCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/inheritance/delegatingToSecondaryCtor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromFakeClasses.kt")
|
||||
public void testFromFakeClasses() throws Exception {
|
||||
|
||||
+6
@@ -5106,6 +5106,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/inheritance/definitionOrder.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegatingToSecondaryCtor.kt")
|
||||
public void testDelegatingToSecondaryCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/inheritance/delegatingToSecondaryCtor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fromFakeClasses.kt")
|
||||
public void testFromFakeClasses() throws Exception {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1344
|
||||
open class MyClass1 private constructor(val value: String) {
|
||||
constructor(i: Int): this(i.toString())
|
||||
}
|
||||
|
||||
class MyClass2 : MyClass1 {
|
||||
constructor(i: Int): super(i)
|
||||
}
|
||||
|
||||
fun test(x: Any) = x is MyClass2
|
||||
|
||||
fun box(): String {
|
||||
val b = test(MyClass2(0))
|
||||
|
||||
return if (b) "OK" else "NOT OK"
|
||||
}
|
||||
Reference in New Issue
Block a user