diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index 0f14a8d7f22..82ca2a487cb 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -2778,6 +2778,30 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index 059653c48b7..d5dac3389b1 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -2778,6 +2778,30 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 1f57835dc47..d78e8f57a89 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -2761,6 +2761,30 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index 9f63d791a0d..8cd44da7256 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -2761,6 +2761,30 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 166b9145afd..0f29bf816ad 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -2761,6 +2761,30 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt index d02cd626081..16a86cc8804 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt @@ -183,22 +183,26 @@ class FirCallCompletionResultsWriterTransformer( qualifiedAccessExpression.replaceTypeArguments(typeArguments) } - for (postponedCall in subCandidate.postponedPCLACalls) { + runPCLARelatedTasksForCandidate(subCandidate) + + session.lookupTracker?.recordTypeResolveAsLookup(type, qualifiedAccessExpression.source, context.file.source) + return qualifiedAccessExpression + } + + private fun runPCLARelatedTasksForCandidate(candidate: Candidate) { + for (postponedCall in candidate.postponedPCLACalls) { postponedCall.transformSingle(this, null) } - for (callback in subCandidate.onCompletionResultsWritingCallbacks) { + for (callback in candidate.onCompletionResultsWritingCallbacks) { callback(finalSubstitutor) } // TODO: Be aware of exponent val firStubTypeTransformer = FirTypeVariablesAfterPCLATransformer(finalSubstitutor) - for (lambda in subCandidate.lambdasAnalyzedWithPCLA) { + for (lambda in candidate.lambdasAnalyzedWithPCLA) { lambda.transformSingle(firStubTypeTransformer, null) } - - session.lookupTracker?.recordTypeResolveAsLookup(type, qualifiedAccessExpression.source, context.file.source) - return qualifiedAccessExpression } /** @@ -674,6 +678,8 @@ class FirCallCompletionResultsWriterTransformer( } } + runPCLARelatedTasksForCandidate(subCandidate) + val argumentsMapping = runIf(!calleeReference.isError) { subCandidate.createArgumentsMapping() } delegatedConstructorCall.transformWithExpectedTypes(argumentsMapping) @@ -914,6 +920,8 @@ class FirCallCompletionResultsWriterTransformer( syntheticCall.replaceTypeWithSubstituted(calleeReference, typeRef) transformSyntheticCallChildren(syntheticCall, data) + runPCLARelatedTasksForCandidate(calleeReference.candidate) + return syntheticCall.apply { replaceCalleeReference(calleeReference.toResolvedReference()) } diff --git a/compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt b/compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt new file mode 100644 index 00000000000..0234e000978 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt @@ -0,0 +1,16 @@ +// ISSUE: KT-65103 +interface Consumer + +public fun buildConsumer( + block: (Consumer) -> Unit +): Any? = "OK" + +fun expectConsumerString(x: Consumer) {} + +abstract class A(val x: Any?) + +class B : A(buildConsumer { + expectConsumerString(it) +}) + +fun box(): String = B().x as String diff --git a/compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt b/compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt new file mode 100644 index 00000000000..91f73747c9a --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt @@ -0,0 +1,18 @@ +// ISSUE: KT-65103 +interface Consumer + +public fun buildConsumer( + b: Boolean, + block: (Consumer) -> Unit +): T? = if (b) ("O" as T) else null + +public fun materialize(): T = "K" as T + +fun expectConsumerString(x: Consumer) {} + +fun elvis(b: Boolean) = + buildConsumer(b) { + expectConsumerString(it) + } ?: materialize() + +fun box(): String = elvis(true) + elvis(false) diff --git a/compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt b/compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt new file mode 100644 index 00000000000..1d2fc9a125b --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt @@ -0,0 +1,29 @@ +// ISSUE: KT-65103 +interface Consumer + +public fun buildConsumer( + block: (Consumer) -> Unit +): T = "O" as T + +public fun materialize(): T = "K" as T + +fun expectConsumerString(x: Consumer) {} + +fun foo1(x: Boolean) = when { + x -> buildConsumer { + expectConsumerString(it) + } + else -> materialize() +} + +fun foo2(x: Boolean) = + if (x) + buildConsumer { + expectConsumerString(it) + } + else + materialize() + +fun box(): String { + return foo1(true) + foo2(false) +} diff --git a/compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt b/compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt new file mode 100644 index 00000000000..4204b07ccf6 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt @@ -0,0 +1,16 @@ +// ISSUE: KT-65103 +interface Consumer + +public fun buildConsumer( + block: (Consumer) -> Unit +): T = "OK" as T + +fun expectConsumerString(x: Consumer) {} + +fun box() = + try { // This try is essential + buildConsumer { + expectConsumerString(it) + } + } finally { + } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java index 4f2e2e4d7c7..25d92434a69 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java @@ -2761,6 +2761,30 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { 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 11b586a416f..d54fad42c22 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 @@ -2581,6 +2581,30 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { 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 6c0bc526f59..fb7a7f5f813 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 @@ -2761,6 +2761,30 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index db3e0e66dff..3aa1efe6f29 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -2761,6 +2761,30 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() 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 1d63249f8bf..25d9d3570d2 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2408,6 +2408,26 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { runTest("compiler/testData/codegen/box/builderInference/receiverUsesOuterTVButReturnTypeIsProper.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index efbcbcec409..bcddf4b6fcc 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -1867,6 +1867,30 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index 02adb9e7d8e..816a679ead9 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -1867,6 +1867,30 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { 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 243ad8dcefd..0c0c831f5d2 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 @@ -1867,6 +1867,30 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 8363a6d8fac..6cf0f8aaed3 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -1867,6 +1867,30 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java index 8f70edd3c45..63493cf9039 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java @@ -1926,6 +1926,30 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java index 2bb44c4f644..c6f98c6ec41 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java @@ -1972,6 +1972,30 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java index 4ecab30fa27..1f94c830c4d 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java @@ -1880,6 +1880,30 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java index 6f1f36c7d48..6e14b603d87 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java @@ -1927,6 +1927,30 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java index 11cb150a04e..5985b0c407e 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java @@ -1855,6 +1855,30 @@ public class FirWasmJsCodegenBoxTestGenerated extends AbstractFirWasmJsCodegenBo runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index a7fcb2f4257..b904fb5c65a 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -1855,6 +1855,30 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/builderInference/lambdaParameterHasTVType.kt"); } + @Test + @TestMetadata("pcaRootIsDelegatedConstructorCall.kt") + public void testPcaRootIsDelegatedConstructorCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pcaRootIsDelegatedConstructorCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsElvisSynthetic.kt") + public void testPclaRootIsElvisSynthetic() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsElvisSynthetic.kt"); + } + + @Test + @TestMetadata("pclaRootIsIfWhenSyntheticCall.kt") + public void testPclaRootIsIfWhenSyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsIfWhenSyntheticCall.kt"); + } + + @Test + @TestMetadata("pclaRootIsTrySyntheticCall.kt") + public void testPclaRootIsTrySyntheticCall() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/pclaRootIsTrySyntheticCall.kt"); + } + @Test @TestMetadata("receiverUsesOuterTVButReturnTypeIsProper.kt") public void testReceiverUsesOuterTVButReturnTypeIsProper() throws Exception {