diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index ef3b7263a70..7496530424d 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -12794,6 +12794,28 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + public class Components { + @Test + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 1884145e889..64269518bf8 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -343,6 +343,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/classes/dataClasses/kt31649.kt"); } + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/ir/irText/classes/dataClasses/kt49936.kt"); + } + @Test @TestMetadata("lambdaInDataClassDefaultParameter.kt") public void testLambdaInDataClassDefaultParameter() throws Exception { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt index fdc061185f7..3ea5cb47a19 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassMemberScope.kt @@ -317,9 +317,7 @@ open class LazyClassMemberScope( if (!primaryConstructorParameters.get(parameter.index).hasValOrVar()) continue val properties = getContributedVariables(parameter.name, location) - if (properties.isEmpty()) continue - - val property = properties.iterator().next() + val property = properties.firstOrNull { it.extensionReceiverParameter == null } ?: continue ++componentIndex diff --git a/compiler/testData/codegen/box/dataClasses/components/kt49812.kt b/compiler/testData/codegen/box/dataClasses/components/kt49812.kt new file mode 100644 index 00000000000..3d83b58ff3f --- /dev/null +++ b/compiler/testData/codegen/box/dataClasses/components/kt49812.kt @@ -0,0 +1,11 @@ +// WITH_STDLIB + +data class Foo(val result: Result) { + val Boolean.result: String get() = if (this) "OK" else "Fail" + + fun f(): String = + result.getOrNull()!!.result +} + +fun box(): String = + Foo(Result.success(true)).f() diff --git a/compiler/testData/codegen/box/dataClasses/components/kt49936.kt b/compiler/testData/codegen/box/dataClasses/components/kt49936.kt new file mode 100644 index 00000000000..110a15479aa --- /dev/null +++ b/compiler/testData/codegen/box/dataClasses/components/kt49936.kt @@ -0,0 +1,5 @@ +data class A(val x: String) { + val Int.x: Int get() = this +} + +fun box(): String = A("OK").component1() diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt new file mode 100644 index 00000000000..8813ce83af6 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt @@ -0,0 +1,98 @@ +FILE fqName: fileName:/kt49936.kt + CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .A.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:x visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null + FUN name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.component1' type=.A origin=null + FUN name:copy visibility:public modality:FINAL <> ($this:.A, x:kotlin.Int) returnType:.A + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.copy' type=.A origin=null + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int): .A declared in .A' + CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .A' type=.A origin=null + x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR ': .A declared in .A.equals' type=.A origin=null + arg1: GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + CONST Boolean type=kotlin.Boolean value=true + WHEN type=kotlin.Unit origin=null + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A + GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + CONST Boolean type=kotlin.Boolean value=false + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + TYPE_OP type=.A origin=CAST typeOperand=.A + GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt new file mode 100644 index 00000000000..d15c5a09345 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.ir.txt @@ -0,0 +1,98 @@ +FILE fqName: fileName:/kt49936.kt + CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .A.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:x visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_VAR ': kotlin.String declared in .A.' type=kotlin.String origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.component1' type=.A origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.A, x:kotlin.Int) returnType:.A + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.copy' type=.A origin=null + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int): .A declared in .A' + CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .A' type=.A origin=null + x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="A(" + CONST String type=kotlin.String value="x=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null + CONST String type=kotlin.String value=")" + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR ': .A declared in .A.equals' type=.A origin=null + arg1: GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' + CONST Boolean type=kotlin.Boolean value=true + WHEN type=kotlin.Unit origin=null + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A + GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' + CONST Boolean type=kotlin.Boolean value=false + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + TYPE_OP type=.A origin=CAST typeOperand=.A + GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' + CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' + CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.kt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.kt new file mode 100644 index 00000000000..1c9b7ac1909 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.kt @@ -0,0 +1,5 @@ +// SKIP_KT_DUMP + +data class A(val x: Int) { + val String.x: String get() = this +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index fafddec17cb..d0232b76085 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -12716,6 +12716,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + public class Components { + @Test + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index b78d8901e30..8b289ede9a3 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -12794,6 +12794,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + public class Components { + @Test + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index 795774713e7..f69bb796617 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -343,6 +343,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/classes/dataClasses/kt31649.kt"); } + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/ir/irText/classes/dataClasses/kt49936.kt"); + } + @Test @TestMetadata("lambdaInDataClassDefaultParameter.kt") public void testLambdaInDataClassDefaultParameter() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index aa1bd992dea..48ab1b63255 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -10268,6 +10268,29 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Components extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java index 22a5e57771b..b97989fdddd 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/ir/KlibTextTestCaseGenerated.java @@ -269,6 +269,11 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/classes/dataClasses/kt31649.kt"); } + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/ir/irText/classes/dataClasses/kt49936.kt"); + } + @TestMetadata("lambdaInDataClassDefaultParameter.kt") public void testLambdaInDataClassDefaultParameter() throws Exception { runTest("compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index 80f340e363d..ed74e99e0bb 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -9556,6 +9556,28 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + public class Components { + @Test + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @Test + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index d7b58711680..20827c87af3 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -9598,6 +9598,28 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + public class Components { + @Test + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 9ccf386bc25..382e1b9aa1a 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -8380,6 +8380,29 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Components extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java index 3f2d9448c75..68a5945d244 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java @@ -12932,6 +12932,29 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest { runTest("compiler/testData/codegen/box/dataClasses/unitComponent.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/dataClasses/components") + @TestDataPath("$PROJECT_ROOT") + @NativeBlackBoxTestCaseGroupProvider(ExtTestCaseGroupProvider.class) + public class Components { + @Test + public void testAllFilesPresentInComponents() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/dataClasses/components"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("kt49812.kt") + public void testKt49812() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49812.kt"); + } + + @Test + @TestMetadata("kt49936.kt") + public void testKt49936() throws Exception { + runTest("compiler/testData/codegen/box/dataClasses/components/kt49936.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/dataClasses/copy") @TestDataPath("$PROJECT_ROOT")