diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt index 719c391ca8f..cb3312947f0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt @@ -231,7 +231,8 @@ class MethodInliner( val inliner = MethodInliner( info.node.node, lambdaParameters, inliningContext.subInlineLambda(info), - newCapturedRemapper, true /*cause all calls in same module as lambda*/, + newCapturedRemapper, + if (info is DefaultLambda) isSameModule else true /*cause all nested objects in same module as lambda*/, "Lambda inlining " + info.lambdaClassType.internalName, childSourceMapper, inlineCallSiteInfo, null ) diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt new file mode 100644 index 00000000000..67343064a32 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt @@ -0,0 +1,140 @@ +// FILE: 1.kt +// SKIP_INLINE_CHECK_IN: lParams$default +package test + +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] +//A lot of blank lines [Don't delete] + +inline fun kValue(crossinline s: () -> String) = { s() + "K" }() + +inline fun lParams(initParams: () -> String = { + { "" + kValue { "O" } }() +}): String { + val z = "body" + return initParams() +} + +// FILE: 2.kt +import test.* + +fun box(): String { + return lParams() +} + +// FILE: 1.smap +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt +*L +1#1,38:1 +34#1,2:39 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$lParams$1 +*L +1#1,38:1 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$lParams$1$1 ++ 2 1.kt +test/_1Kt +*L +1#1,38:1 +29#2:39 +*E +*S KotlinDebug +*F ++ 1 1.kt +test/_1Kt$lParams$1$1 +*L +32#1:39 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$kValue$1 ++ 2 1.kt +test/_1Kt$lParams$1$1 +*L +1#1,38:1 +32#2:39 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$kValue$1 +*L +1#1,38:1 +*E + +// FILE: 2.smap + +SMAP +2.kt +Kotlin +*S Kotlin +*F ++ 1 2.kt +_2Kt ++ 2 1.kt +test/_1Kt ++ 3 1.kt +test/_1Kt$lParams$1 +*L +1#1,8:1 +31#2,5:9 +32#3:14 +*E +*S KotlinDebug +*F ++ 1 2.kt +_2Kt +*L +5#1,5:9 +5#1:14 +*E \ No newline at end of file diff --git a/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt new file mode 100644 index 00000000000..ab9c4ceae8e --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// FILE: A.kt + +package test + +inline fun test(s: () -> () -> String = { val z = "Outer"; { "OK" } }) = + s() + +val same = test() + +// FILE: B.kt + +import test.* + +fun box(): String { + val inlined = test() + if (same::class.java == inlined::class.java) return "fail 1 : ${same::class.java} == ${inlined::class.java}" + println (inlined::class.java) + return inlined() +} diff --git a/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt new file mode 100644 index 00000000000..c9a7910ab6a --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// FILE: A.kt + +package test + +inline fun test(s: () -> () -> () -> String = { val z = "Outer"; { { "OK" } } }) = + s() + +val same = test() + +// FILE: B.kt + +import test.* + +fun box(): String { + val inlined = test() + if (same::class.java == inlined::class.java) return "fail 1 : ${same::class.java} == ${inlined::class.java}" + if (same()::class.java == inlined()::class.java) return "fail 2 : ${same()::class.java} == ${inlined()::class.java}" + return inlined()() +} diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index e001f38a797..d83c657ac32 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -1210,6 +1210,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultCallInDefaultLambda.kt") + public void testDefaultCallInDefaultLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultCallInDefaultLambda.kt"); + doTest(fileName); + } + @TestMetadata("defaultLambdaInNoInline.kt") public void testDefaultLambdaInNoInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt"); @@ -3035,51 +3041,6 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli } } - @TestMetadata("compiler/testData/codegen/boxInline/smap/default") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Default extends AbstractIrBlackBoxInlineCodegenTest { - public void testAllFilesPresentInDefault() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/default"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); - } - - @TestMetadata("inlinInDefault.kt") - public void testInlinInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlinInDefault2.kt") - public void testInlinInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault.kt") - public void testInlineAnonymousInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault2.kt") - public void testInlineAnonymousInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("kt21827.kt") - public void testKt21827() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/kt21827.kt"); - doTest(fileName); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/simple.kt"); - doTest(fileName); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -3088,6 +3049,42 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/defaultLambda"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultLambdaInAnonymous.kt") + public void testDefaultLambdaInAnonymous() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault.kt") + public void testInlinInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault2.kt") + public void testInlinInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault.kt") + public void testInlineAnonymousInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault2.kt") + public void testInlineAnonymousInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("kt21827.kt") + public void testKt21827() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt"); + doTest(fileName); + } + @TestMetadata("nested.kt") public void testNested() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt"); @@ -3099,6 +3096,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt"); doTest(fileName); } + + @TestMetadata("simple2.kt") + public void testSimple2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/boxInline/smap/inlineOnly") diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 9913d8aba70..46e6054eac9 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1210,6 +1210,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultCallInDefaultLambda.kt") + public void testDefaultCallInDefaultLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultCallInDefaultLambda.kt"); + doTest(fileName); + } + @TestMetadata("defaultLambdaInNoInline.kt") public void testDefaultLambdaInNoInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt"); @@ -3035,51 +3041,6 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC } } - @TestMetadata("compiler/testData/codegen/boxInline/smap/default") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Default extends AbstractIrCompileKotlinAgainstInlineKotlinTest { - public void testAllFilesPresentInDefault() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/default"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); - } - - @TestMetadata("inlinInDefault.kt") - public void testInlinInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlinInDefault2.kt") - public void testInlinInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault.kt") - public void testInlineAnonymousInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault2.kt") - public void testInlineAnonymousInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("kt21827.kt") - public void testKt21827() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/kt21827.kt"); - doTest(fileName); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/simple.kt"); - doTest(fileName); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -3088,6 +3049,42 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/defaultLambda"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultLambdaInAnonymous.kt") + public void testDefaultLambdaInAnonymous() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault.kt") + public void testInlinInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault2.kt") + public void testInlinInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault.kt") + public void testInlineAnonymousInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault2.kt") + public void testInlineAnonymousInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("kt21827.kt") + public void testKt21827() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt"); + doTest(fileName); + } + @TestMetadata("nested.kt") public void testNested() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt"); @@ -3099,6 +3096,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt"); doTest(fileName); } + + @TestMetadata("simple2.kt") + public void testSimple2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/boxInline/smap/inlineOnly") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 29b30fd4574..3dd110c5264 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -1210,6 +1210,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultCallInDefaultLambda.kt") + public void testDefaultCallInDefaultLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultCallInDefaultLambda.kt"); + doTest(fileName); + } + @TestMetadata("defaultLambdaInNoInline.kt") public void testDefaultLambdaInNoInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt"); @@ -3035,51 +3041,6 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo } } - @TestMetadata("compiler/testData/codegen/boxInline/smap/default") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Default extends AbstractBlackBoxInlineCodegenTest { - public void testAllFilesPresentInDefault() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/default"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); - } - - @TestMetadata("inlinInDefault.kt") - public void testInlinInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlinInDefault2.kt") - public void testInlinInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault.kt") - public void testInlineAnonymousInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault2.kt") - public void testInlineAnonymousInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("kt21827.kt") - public void testKt21827() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/kt21827.kt"); - doTest(fileName); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/simple.kt"); - doTest(fileName); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -3088,6 +3049,42 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/defaultLambda"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultLambdaInAnonymous.kt") + public void testDefaultLambdaInAnonymous() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault.kt") + public void testInlinInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault2.kt") + public void testInlinInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault.kt") + public void testInlineAnonymousInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault2.kt") + public void testInlineAnonymousInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("kt21827.kt") + public void testKt21827() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt"); + doTest(fileName); + } + @TestMetadata("nested.kt") public void testNested() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt"); @@ -3099,6 +3096,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt"); doTest(fileName); } + + @TestMetadata("simple2.kt") + public void testSimple2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/boxInline/smap/inlineOnly") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 4252a32a0df..69668aaab31 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1210,6 +1210,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultCallInDefaultLambda.kt") + public void testDefaultCallInDefaultLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultCallInDefaultLambda.kt"); + doTest(fileName); + } + @TestMetadata("defaultLambdaInNoInline.kt") public void testDefaultLambdaInNoInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt"); @@ -3035,51 +3041,6 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi } } - @TestMetadata("compiler/testData/codegen/boxInline/smap/default") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Default extends AbstractCompileKotlinAgainstInlineKotlinTest { - public void testAllFilesPresentInDefault() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/default"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); - } - - @TestMetadata("inlinInDefault.kt") - public void testInlinInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlinInDefault2.kt") - public void testInlinInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlinInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault.kt") - public void testInlineAnonymousInDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault.kt"); - doTest(fileName); - } - - @TestMetadata("inlineAnonymousInDefault2.kt") - public void testInlineAnonymousInDefault2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/inlineAnonymousInDefault2.kt"); - doTest(fileName); - } - - @TestMetadata("kt21827.kt") - public void testKt21827() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/kt21827.kt"); - doTest(fileName); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/default/simple.kt"); - doTest(fileName); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -3088,6 +3049,42 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/defaultLambda"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("defaultLambdaInAnonymous.kt") + public void testDefaultLambdaInAnonymous() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault.kt") + public void testInlinInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlinInDefault2.kt") + public void testInlinInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault.kt") + public void testInlineAnonymousInDefault() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt"); + doTest(fileName); + } + + @TestMetadata("inlineAnonymousInDefault2.kt") + public void testInlineAnonymousInDefault2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt"); + doTest(fileName); + } + + @TestMetadata("kt21827.kt") + public void testKt21827() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt"); + doTest(fileName); + } + @TestMetadata("nested.kt") public void testNested() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt"); @@ -3099,6 +3096,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt"); doTest(fileName); } + + @TestMetadata("simple2.kt") + public void testSimple2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/boxInline/smap/inlineOnly") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index db05999b1b0..c4de6ad4397 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -102,6 +102,18 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl doTest(fileName); } + @TestMetadata("defaultLambdaRegeneration.kt") + public void testDefaultLambdaRegeneration() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt"); + doTest(fileName); + } + + @TestMetadata("defaultLambdaRegeneration2.kt") + public void testDefaultLambdaRegeneration2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt"); + doTest(fileName); + } + @TestMetadata("doublyNestedClass.kt") public void testDoublyNestedClass() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/doublyNestedClass.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java index 66f0041f7f5..83d61d9e4dd 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineDefaultValuesTestsGenerated.java @@ -158,6 +158,12 @@ public class InlineDefaultValuesTestsGenerated extends AbstractInlineDefaultValu KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } + @TestMetadata("defaultCallInDefaultLambda.kt") + public void testDefaultCallInDefaultLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultCallInDefaultLambda.kt"); + doTest(fileName); + } + @TestMetadata("defaultLambdaInNoInline.kt") public void testDefaultLambdaInNoInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt");