[IR] Fix synthetic declarations generator to make it produce correct type

- Fix KT-40126
 - Add test
This commit is contained in:
Roman Artemev
2020-07-08 23:35:32 +03:00
committed by romanart
parent d8f5b50cd8
commit ca44242f37
7 changed files with 40 additions and 10 deletions
@@ -1271,6 +1271,11 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test {
runTest("js/js.translator/testData/box/delegation/delegationExtensionPropertyDelegated.kt");
}
@TestMetadata("delegationToExternaInterface.kt")
public void testDelegationToExternaInterface() throws Exception {
runTest("js/js.translator/testData/box/delegation/delegationToExternaInterface.kt");
}
@TestMetadata("jsNamePropertyDelegation.kt")
public void testJsNamePropertyDelegation() throws Exception {
runTest("js/js.translator/testData/box/delegation/jsNamePropertyDelegation.kt");
@@ -1271,6 +1271,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/delegation/delegationExtensionPropertyDelegated.kt");
}
@TestMetadata("delegationToExternaInterface.kt")
public void testDelegationToExternaInterface() throws Exception {
runTest("js/js.translator/testData/box/delegation/delegationToExternaInterface.kt");
}
@TestMetadata("jsNamePropertyDelegation.kt")
public void testJsNamePropertyDelegation() throws Exception {
runTest("js/js.translator/testData/box/delegation/jsNamePropertyDelegation.kt");
@@ -1271,6 +1271,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/delegation/delegationExtensionPropertyDelegated.kt");
}
@TestMetadata("delegationToExternaInterface.kt")
public void testDelegationToExternaInterface() throws Exception {
runTest("js/js.translator/testData/box/delegation/delegationToExternaInterface.kt");
}
@TestMetadata("jsNamePropertyDelegation.kt")
public void testJsNamePropertyDelegation() throws Exception {
runTest("js/js.translator/testData/box/delegation/jsNamePropertyDelegation.kt");
@@ -0,0 +1,15 @@
// EXPECTED_REACHABLE_NODES: 1236
// KJS_WITH_FULL_RUNTIME
// KT-40126
@file:Suppress("EXTERNAL_DELEGATION")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
external interface MySymbol {
companion object : MySymbolConstructor by definedExternally
}
external interface MySymbolConstructor {
@nativeInvoke
operator fun invoke(description: String = definedExternally): Any
}
fun box() = "OK"