[K/JS] Allow declare inline functions inside external declarations with a million suppresses ^KT-48154 Fixed

This commit is contained in:
Artem Kobzar
2023-04-13 08:53:57 +00:00
committed by Space Team
parent 09bccd272d
commit c695da1bed
7 changed files with 56 additions and 3 deletions
@@ -4756,6 +4756,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/inline/extensionWithManyArguments.kt");
}
@Test
@TestMetadata("externalInlineWithSuppress.kt")
public void testExternalInlineWithSuppress() throws Exception {
runTest("js/js.translator/testData/box/inline/externalInlineWithSuppress.kt");
}
@Test
@TestMetadata("fakeOverrideInlining.kt")
public void testFakeOverrideInlining() throws Exception {
@@ -5372,6 +5372,12 @@ public class FirJsBoxTestGenerated extends AbstractFirJsBoxTest {
runTest("js/js.translator/testData/box/inline/extensionWithManyArguments.kt");
}
@Test
@TestMetadata("externalInlineWithSuppress.kt")
public void testExternalInlineWithSuppress() throws Exception {
runTest("js/js.translator/testData/box/inline/externalInlineWithSuppress.kt");
}
@Test
@TestMetadata("fakeOverrideInlining.kt")
public void testFakeOverrideInlining() throws Exception {
@@ -5478,6 +5478,12 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test {
runTest("js/js.translator/testData/box/inline/extensionWithManyArguments.kt");
}
@Test
@TestMetadata("externalInlineWithSuppress.kt")
public void testExternalInlineWithSuppress() throws Exception {
runTest("js/js.translator/testData/box/inline/externalInlineWithSuppress.kt");
}
@Test
@TestMetadata("fakeOverrideInlining.kt")
public void testFakeOverrideInlining() throws Exception {
@@ -5372,6 +5372,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/inline/extensionWithManyArguments.kt");
}
@Test
@TestMetadata("externalInlineWithSuppress.kt")
public void testExternalInlineWithSuppress() throws Exception {
runTest("js/js.translator/testData/box/inline/externalInlineWithSuppress.kt");
}
@Test
@TestMetadata("fakeOverrideInlining.kt")
public void testFakeOverrideInlining() throws Exception {
@@ -0,0 +1,26 @@
// EXPECTED_REACHABLE_NODES: 1284
// IGNORE_BACKEND: JS
// FILE: main.kt
@file:Suppress(
"NESTED_CLASS_IN_EXTERNAL_INTERFACE",
"WRONG_BODY_OF_EXTERNAL_DECLARATION",
"INLINE_EXTERNAL_DECLARATION",
"NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE",
"DECLARATION_CANT_BE_INLINED",
)
package foo
@JsName("null")
external interface Foo {
companion object {
inline fun test(): String = "OK"
}
}
fun box(): String {
return Foo.test()
}
// FILE: lib.js
function Foo() {}