diff --git a/compiler/testData/codegen/box/defaultArguments/complexInheritance.kt b/compiler/testData/codegen/box/defaultArguments/complexInheritance.kt new file mode 100644 index 00000000000..515521b1458 --- /dev/null +++ b/compiler/testData/codegen/box/defaultArguments/complexInheritance.kt @@ -0,0 +1,14 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// FILE: A.kt + +interface A : B + +fun box(): String = object : A {}.foo() + +// FILE: B.kt + +interface Base { + fun foo(s: String = "OK"): String = s +} + +interface B : Base \ No newline at end of file diff --git a/compiler/testData/codegen/box/properties/complexPropertyInitializer.kt b/compiler/testData/codegen/box/properties/complexPropertyInitializer.kt new file mode 100644 index 00000000000..4ca5a36dd8a --- /dev/null +++ b/compiler/testData/codegen/box/properties/complexPropertyInitializer.kt @@ -0,0 +1,12 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// WITH_RUNTIME +// KJS_WITH_FULL_RUNTIME + +class A { + val s: Sequence = sequence { + val a = {} + yield("OK") + } +} + +fun box(): String = A().s.single() \ No newline at end of file diff --git a/compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt b/compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt new file mode 100644 index 00000000000..22e6ad89b90 --- /dev/null +++ b/compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt @@ -0,0 +1,14 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR +// WITH_RUNTIME +// WITH_REFLECT + +import kotlin.reflect.jvm.* +import kotlin.test.assertNotNull + +fun box(): String { + assertNotNull({}.reflect()) + assertNotNull(Array(1) { {} }.single().reflect()) + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 6f0b2a88269..6a5ed1aa5f3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -9246,6 +9246,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt"); } + @TestMetadata("complexInheritance.kt") + public void testComplexInheritance() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/complexInheritance.kt"); + } + @TestMetadata("implementedByFake.kt") public void testImplementedByFake() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/implementedByFake.kt"); @@ -19451,6 +19456,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/properties/companionPrivateFieldInsideLambda.kt"); } + @TestMetadata("complexPropertyInitializer.kt") + public void testComplexPropertyInitializer() throws Exception { + runTest("compiler/testData/codegen/box/properties/complexPropertyInitializer.kt"); + } + @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/codegen/box/properties/field.kt"); @@ -24421,6 +24431,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnDefaultWithInlineClassArgument.kt"); } + @TestMetadata("reflectOnLambdaInArrayConstructor.kt") + public void testReflectOnLambdaInArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt"); + } + @TestMetadata("reflectOnLambdaInField.kt") public void testReflectOnLambdaInField() throws Exception { runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInField.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 492dea0484d..3adadddf36d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -9261,6 +9261,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt"); } + @TestMetadata("complexInheritance.kt") + public void testComplexInheritance() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/complexInheritance.kt"); + } + @TestMetadata("inheritedFromInterfaceViaAbstractSuperclass.kt") public void testInheritedFromInterfaceViaAbstractSuperclass() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/inheritedFromInterfaceViaAbstractSuperclass.kt"); @@ -19456,6 +19461,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/properties/companionPrivateFieldInsideLambda.kt"); } + @TestMetadata("complexPropertyInitializer.kt") + public void testComplexPropertyInitializer() throws Exception { + runTest("compiler/testData/codegen/box/properties/complexPropertyInitializer.kt"); + } + @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/codegen/box/properties/field.kt"); @@ -23238,6 +23248,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnDefaultWithInlineClassArgument.kt"); } + @TestMetadata("reflectOnLambdaInArrayConstructor.kt") + public void testReflectOnLambdaInArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt"); + } + @TestMetadata("reflectOnLambdaInField.kt") public void testReflectOnLambdaInField() throws Exception { runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInField.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 8416da69d99..ece90e8944e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -8121,6 +8121,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt"); } + @TestMetadata("complexInheritance.kt") + public void testComplexInheritance() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/complexInheritance.kt"); + } + @TestMetadata("implementedByFake.kt") public void testImplementedByFake() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/implementedByFake.kt"); @@ -17960,6 +17965,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/properties/companionPrivateFieldInsideLambda.kt"); } + @TestMetadata("complexPropertyInitializer.kt") + public void testComplexPropertyInitializer() throws Exception { + runTest("compiler/testData/codegen/box/properties/complexPropertyInitializer.kt"); + } + @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/codegen/box/properties/field.kt"); @@ -22930,6 +22940,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnDefaultWithInlineClassArgument.kt"); } + @TestMetadata("reflectOnLambdaInArrayConstructor.kt") + public void testReflectOnLambdaInArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt"); + } + @TestMetadata("reflectOnLambdaInField.kt") public void testReflectOnLambdaInField() throws Exception { runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInField.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 6988fbcaa11..550e68bc7e2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -8121,6 +8121,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt"); } + @TestMetadata("complexInheritance.kt") + public void testComplexInheritance() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/complexInheritance.kt"); + } + @TestMetadata("implementedByFake.kt") public void testImplementedByFake() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/implementedByFake.kt"); @@ -17960,6 +17965,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/properties/companionPrivateFieldInsideLambda.kt"); } + @TestMetadata("complexPropertyInitializer.kt") + public void testComplexPropertyInitializer() throws Exception { + runTest("compiler/testData/codegen/box/properties/complexPropertyInitializer.kt"); + } + @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/codegen/box/properties/field.kt"); @@ -22930,6 +22940,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnDefaultWithInlineClassArgument.kt"); } + @TestMetadata("reflectOnLambdaInArrayConstructor.kt") + public void testReflectOnLambdaInArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInArrayConstructor.kt"); + } + @TestMetadata("reflectOnLambdaInField.kt") public void testReflectOnLambdaInField() throws Exception { runTest("compiler/testData/codegen/box/reflection/lambdaClasses/reflectOnLambdaInField.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index e102f05e467..aab141321f3 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -6906,6 +6906,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt"); } + @TestMetadata("complexInheritance.kt") + public void testComplexInheritance() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/complexInheritance.kt"); + } + @TestMetadata("implementedByFake.kt") public void testImplementedByFake() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/implementedByFake.kt"); @@ -15041,6 +15046,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/properties/companionPrivateFieldInsideLambda.kt"); } + @TestMetadata("complexPropertyInitializer.kt") + public void testComplexPropertyInitializer() throws Exception { + runTest("compiler/testData/codegen/box/properties/complexPropertyInitializer.kt"); + } + @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/codegen/box/properties/field.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index d34a6c6d07c..c3442b872bf 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -6906,6 +6906,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/defaultArguments/callDefaultFromInitializer.kt"); } + @TestMetadata("complexInheritance.kt") + public void testComplexInheritance() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/complexInheritance.kt"); + } + @TestMetadata("implementedByFake.kt") public void testImplementedByFake() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/implementedByFake.kt"); @@ -15146,6 +15151,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/properties/companionPrivateFieldInsideLambda.kt"); } + @TestMetadata("complexPropertyInitializer.kt") + public void testComplexPropertyInitializer() throws Exception { + runTest("compiler/testData/codegen/box/properties/complexPropertyInitializer.kt"); + } + @TestMetadata("field.kt") public void testField() throws Exception { runTest("compiler/testData/codegen/box/properties/field.kt");