From 678816f9e8cc9ff09a9472142752694aa8102541 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 26 Feb 2024 10:06:29 +0100 Subject: [PATCH] K1: introduce BUILDER_INFERENCE_STUB_PARAMETER_TYPE to prevent compiler crashes This diagnostic is reported in rare situations when StubTypeForBuilderInference is kept as a parameter type of for loop or lambda. Before this commit, we had in K1 "Could not load module " from IrLinker instead. Related to: KT-52757, KT-53109, KT-63841, KT-64066 #KT-53478 Fixed --- ...CompilerTestFE10TestdataTestGenerated.java | 18 ++++++++++++ ...LFirBlackBoxCodegenBasedTestGenerated.java | 12 ++++++++ ...sticCompilerFE10TestDataTestGenerated.java | 18 ++++++++++++ ...rsedBlackBoxCodegenBasedTestGenerated.java | 12 ++++++++ ...eeOldFrontendDiagnosticsTestGenerated.java | 18 ++++++++++++ ...siOldFrontendDiagnosticsTestGenerated.java | 18 ++++++++++++ ...LightTreeBlackBoxCodegenTestGenerated.java | 12 ++++++++ ...hIrFakeOverrideGeneratorTestGenerated.java | 12 ++++++++ .../FirPsiBlackBoxCodegenTestGenerated.java | 12 ++++++++ .../jetbrains/kotlin/diagnostics/Errors.java | 1 + .../rendering/DefaultErrorMessages.java | 1 + .../resolve/PlatformConfiguratorBase.kt | 3 +- .../BuilderInferenceAssignmentChecker.kt | 23 +++++++++++---- ...ForBuilderInferenceParameterTypeChecker.kt | 26 +++++++++++++++++ .../box/builderInference/issues/kt52757.kt | 3 +- .../box/builderInference/issues/kt53109.kt | 3 +- .../box/builderInference/issues/kt53478.kt | 19 +++++++++++++ .../box/builderInference/issues/kt64066.kt | 13 +++++++++ .../builderInference/issues/kt52757.fir.kt | 28 +++++++++++++++++++ .../tests/builderInference/issues/kt52757.kt | 3 +- .../builderInference/issues/kt53109.fir.kt | 27 ++++++++++++++++++ .../tests/builderInference/issues/kt53109.kt | 3 +- .../builderInference/issues/kt53478.fir.kt | 16 +++++++++++ .../tests/builderInference/issues/kt53478.kt | 16 +++++++++++ .../builderInference/issues/kt64066.fir.kt | 9 ++++++ .../tests/builderInference/issues/kt64066.kt | 9 ++++++ .../issues/kt64066disabled.kt | 26 +++++++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 18 ++++++++++++ .../JvmAbiConsistencyTestBoxGenerated.java | 12 ++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 ++++++++ .../IrBlackBoxCodegenTestGenerated.java | 12 ++++++++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 12 ++++++++ ...xCodegenTestWithInlineScopesGenerated.java | 12 ++++++++ .../LightAnalysisModeTestGenerated.java | 10 +++++++ .../fir/FirJsCodegenBoxTestGenerated.java | 12 ++++++++ .../fir/FirJsES6CodegenBoxTestGenerated.java | 12 ++++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 12 ++++++++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 12 ++++++++ .../FirNativeCodegenBoxTestGenerated.java | 12 ++++++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 12 ++++++++ .../NativeCodegenBoxTestGenerated.java | 12 ++++++++ .../NativeCodegenBoxTestNoPLGenerated.java | 12 ++++++++ .../FirWasmJsCodegenBoxTestGenerated.java | 12 ++++++++ .../test/K1WasmCodegenBoxTestGenerated.java | 12 ++++++++ 44 files changed, 554 insertions(+), 15 deletions(-) create mode 100644 compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/StubForBuilderInferenceParameterTypeChecker.kt create mode 100644 compiler/testData/codegen/box/builderInference/issues/kt53478.kt create mode 100644 compiler/testData/codegen/box/builderInference/issues/kt64066.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt52757.fir.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt53109.fir.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt53478.fir.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt64066.fir.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt create mode 100644 compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 08c647693c0c2..80ae5ab6c54f6 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -4049,6 +4049,12 @@ public void testKt53422b() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -4235,6 +4241,18 @@ public void testKt63841() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt"); } + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt"); + } + + @Test + @TestMetadata("kt64066disabled.kt") + public void testKt64066disabled() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt"); + } + @Test @TestMetadata("kt64077.kt") public void testKt64077() { 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 603fb7e182cbc..9c6b532817a52 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 @@ -3683,6 +3683,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3856,6 +3862,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index c15f8ff4cc82c..f8c9b269b6e93 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -4049,6 +4049,12 @@ public void testKt53422b() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -4235,6 +4241,18 @@ public void testKt63841() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt"); } + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt"); + } + + @Test + @TestMetadata("kt64066disabled.kt") + public void testKt64066disabled() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt"); + } + @Test @TestMetadata("kt64077.kt") public void testKt64077() { 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 43d5e537aca86..5fc2f0f9dd02c 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 @@ -3683,6 +3683,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3856,6 +3862,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 897a1b5c182b6..4992fcd659ca2 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -4043,6 +4043,12 @@ public void testKt53422b() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -4229,6 +4235,18 @@ public void testKt63841() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt"); } + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt"); + } + + @Test + @TestMetadata("kt64066disabled.kt") + public void testKt64066disabled() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt"); + } + @Test @TestMetadata("kt64077.kt") public void testKt64077() { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 98e4250d7b74c..4631f8f2f27c6 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -4049,6 +4049,12 @@ public void testKt53422b() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -4235,6 +4241,18 @@ public void testKt63841() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt"); } + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt"); + } + + @Test + @TestMetadata("kt64066disabled.kt") + public void testKt64066disabled() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt"); + } + @Test @TestMetadata("kt64077.kt") public void testKt64077() { 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 966eb87479dcf..8434133d61acf 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 @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 97fd5c299de31..9554354fefdbc 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 @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 9135180233dd2..eb38e8c068b69 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 @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 0c432d2d91120..ff6e8c2e38159 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -949,6 +949,7 @@ enum BadNamedArgumentsTarget { DiagnosticFactory4 STUB_TYPE_IN_RECEIVER_CAUSES_AMBIGUITY = DiagnosticFactory4.create(ERROR); DiagnosticFactory2 BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION = DiagnosticFactory2.create(ERROR); DiagnosticFactory2 BUILDER_INFERENCE_STUB_RECEIVER = DiagnosticFactory2.create(ERROR); + DiagnosticFactory1 BUILDER_INFERENCE_STUB_PARAMETER_TYPE = DiagnosticFactory1.create(ERROR); DiagnosticFactory4 UPPER_BOUND_VIOLATION_IN_CONSTRAINT = DiagnosticFactory4.create(ERROR); DiagnosticFactory1>> NONE_APPLICABLE = DiagnosticFactory1.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 54e0fedff43a1..7550441034866 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -1106,6 +1106,7 @@ public static DiagnosticRenderer getRendererForDiagnostic(@NotNull UnboundDiagno MAP.put(STUB_TYPE_IN_RECEIVER_CAUSES_AMBIGUITY, "The type of a receiver hasn''t been inferred yet. To disambiguate this call, explicitly cast it to `{0}` if you want the builder''s type parameter(s) `{1}` to be inferred to `{2}`.", RENDER_TYPE, STRING, STRING, null); MAP.put(BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION, "Unstable inference behaviour with multiple lambdas. Please either specify the type argument for generic parameter `{0}` of `{1}` explicitly", TO_STRING, TO_STRING); MAP.put(BUILDER_INFERENCE_STUB_RECEIVER, "The type of a receiver hasn''t been inferred yet. Please specify type argument for generic parameter `{0}` of `{1}` explicitly", TO_STRING, TO_STRING); + MAP.put(BUILDER_INFERENCE_STUB_PARAMETER_TYPE, "The type of parameter `{0}` cannot be inferred by builder inference", TO_STRING); MAP.put(UPPER_BOUND_VIOLATION_IN_CONSTRAINT, "Upper bound violation for generic parameter `{0}` of `{1}`: {3} is not a subtype of {2}", TO_STRING, TO_STRING, RENDER_TYPE, RENDER_TYPE); MAP.put(NONE_APPLICABLE, "None of the following functions can be called with the arguments supplied: {0}", AMBIGUOUS_CALLS); MAP.put(CANNOT_COMPLETE_RESOLVE, "Cannot choose among the following candidates without completing type inference: {0}", AMBIGUOUS_CALLS); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt index 2b30e69dc2cd2..3654fefa7fb49 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/PlatformConfiguratorBase.kt @@ -62,6 +62,7 @@ private val DEFAULT_DECLARATION_CHECKERS = listOf( EnumEntriesRedeclarationChecker, VolatileAnnotationChecker, ActualTypealiasToSpecialAnnotationChecker, + StubForBuilderInferenceParameterTypeChecker, ) private val DEFAULT_CALL_CHECKERS = listOf( @@ -80,7 +81,7 @@ private val DEFAULT_CALL_CHECKERS = listOf( NewSchemeOfIntegerOperatorResolutionChecker, EnumEntryVsCompanionPriorityCallChecker, CompanionInParenthesesLHSCallChecker, ResolutionToPrivateConstructorOfSealedClassChecker, EqualityCallChecker, UnsupportedUntilOperatorChecker, BuilderInferenceAssignmentChecker, IncorrectCapturedApproximationCallChecker, CompanionIncorrectlyUnboundedWhenUsedAsLHSCallChecker, - CustomEnumEntriesMigrationCallChecker, EnumEntriesUnsupportedChecker + CustomEnumEntriesMigrationCallChecker, EnumEntriesUnsupportedChecker, ) private val DEFAULT_TYPE_CHECKERS = emptyList() private val DEFAULT_CLASSIFIER_USAGE_CHECKERS = listOf( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/BuilderInferenceAssignmentChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/BuilderInferenceAssignmentChecker.kt index 49d8713e6de5e..1248ef9fe0b95 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/BuilderInferenceAssignmentChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/BuilderInferenceAssignmentChecker.kt @@ -11,8 +11,10 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.KtBinaryExpression +import org.jetbrains.kotlin.psi.KtLambdaExpression import org.jetbrains.kotlin.psi.KtNameReferenceExpression import org.jetbrains.kotlin.psi.psiUtil.getParentOfType +import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.calls.util.getType import org.jetbrains.kotlin.types.StubTypeForBuilderInference @@ -24,18 +26,27 @@ object BuilderInferenceAssignmentChecker : CallChecker { val resultingDescriptor = resolvedCall.resultingDescriptor if (resultingDescriptor !is PropertyDescriptor) return if (context.languageVersionSettings.supportsFeature(LanguageFeature.NoBuilderInferenceWithoutAnnotationRestriction)) return - if (resolvedCall.candidateDescriptor.returnType !is StubTypeForBuilderInference) return val callElement = resolvedCall.call.callElement if (callElement !is KtNameReferenceExpression) return val binaryExpression = callElement.getParentOfType(strict = true) ?: return if (binaryExpression.operationToken != KtTokens.EQ) return if (!BasicExpressionTypingVisitor.isLValue(callElement, binaryExpression)) return - - val leftType = resultingDescriptor.returnType?.takeIf { !it.isError } ?: return val right = binaryExpression.right ?: return - val rightType = right.getType(context.trace.bindingContext) ?: return - if (isAssignmentCorrectWithDataFlowInfo(leftType, right, rightType, context)) return - context.trace.report(Errors.TYPE_MISMATCH.on(right, leftType, rightType)) + if (resolvedCall.candidateDescriptor.returnType is StubTypeForBuilderInference) { + val leftType = resultingDescriptor.returnType?.takeIf { !it.isError } ?: return + val rightType = right.getType(context.trace.bindingContext) ?: return + + if (isAssignmentCorrectWithDataFlowInfo(leftType, right, rightType, context)) return + context.trace.report(Errors.TYPE_MISMATCH.on(right, leftType, rightType)) + } else if (right is KtLambdaExpression) { + val functionLiteral = right.functionLiteral + val functionDescriptor = context.trace.get(BindingContext.FUNCTION, right.functionLiteral) ?: return + for ((index, valueParameterDescriptor) in functionDescriptor.valueParameters.withIndex()) { + if (valueParameterDescriptor.type !is StubTypeForBuilderInference) continue + val target = functionLiteral.valueParameters.getOrNull(index) ?: functionLiteral + context.trace.report(Errors.BUILDER_INFERENCE_STUB_PARAMETER_TYPE.on(target, valueParameterDescriptor.name)) + } + } } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/StubForBuilderInferenceParameterTypeChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/StubForBuilderInferenceParameterTypeChecker.kt new file mode 100644 index 0000000000000..e7335c0272eed --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/StubForBuilderInferenceParameterTypeChecker.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.resolve.checkers + +import org.jetbrains.kotlin.config.LanguageFeature +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.descriptors.ValueDescriptor +import org.jetbrains.kotlin.diagnostics.Errors +import org.jetbrains.kotlin.psi.KtDeclaration +import org.jetbrains.kotlin.psi.KtParameter +import org.jetbrains.kotlin.types.StubTypeForBuilderInference + +object StubForBuilderInferenceParameterTypeChecker : DeclarationChecker { + override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) { + if (declaration !is KtParameter || + descriptor !is ValueDescriptor || + descriptor.returnType !is StubTypeForBuilderInference + ) return + if (context.languageVersionSettings.supportsFeature(LanguageFeature.NoBuilderInferenceWithoutAnnotationRestriction)) return + + context.trace.report(Errors.BUILDER_INFERENCE_STUB_PARAMETER_TYPE.on(declaration, declaration.nameAsSafeName)) + } +} diff --git a/compiler/testData/codegen/box/builderInference/issues/kt52757.kt b/compiler/testData/codegen/box/builderInference/issues/kt52757.kt index 74683111e5796..c853ec7bb2d1a 100644 --- a/compiler/testData/codegen/box/builderInference/issues/kt52757.kt +++ b/compiler/testData/codegen/box/builderInference/issues/kt52757.kt @@ -2,8 +2,7 @@ // IGNORE_LIGHT_ANALYSIS // IGNORE_BACKEND_K1: ANY -// REASON: compile-time failure in K1/JVM (java.lang.AssertionError: Could not load module @ org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.resolveModuleDeserializer) -// REASON: compile-time failure in K1/Native, K1/WASM, K1/JS (java.lang.NullPointerException @ org.jetbrains.kotlin.backend.common.serialization.mangle.descriptor.DescriptorExportCheckerVisitor.isExported) +// Reason: red code fun box(): String { build { diff --git a/compiler/testData/codegen/box/builderInference/issues/kt53109.kt b/compiler/testData/codegen/box/builderInference/issues/kt53109.kt index 149046963c41d..884d592ab44d0 100644 --- a/compiler/testData/codegen/box/builderInference/issues/kt53109.kt +++ b/compiler/testData/codegen/box/builderInference/issues/kt53109.kt @@ -2,8 +2,7 @@ // IGNORE_LIGHT_ANALYSIS // IGNORE_BACKEND_K1: ANY -// REASON: compile-time failure in K1/JVM (java.lang.AssertionError: Could not load module @ org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.resolveModuleDeserializer) -// REASON: compile-time failure in K1/Native, K1/WASM, K1/JS (java.lang.NullPointerException @ org.jetbrains.kotlin.backend.common.serialization.mangle.descriptor.DescriptorExportCheckerVisitor.isExported) +// REASON: red code fun box(): String { build { diff --git a/compiler/testData/codegen/box/builderInference/issues/kt53478.kt b/compiler/testData/codegen/box/builderInference/issues/kt53478.kt new file mode 100644 index 0000000000000..5ad3deb2b6717 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/issues/kt53478.kt @@ -0,0 +1,19 @@ +// ISSUE: KT-53478 +// IGNORE_BACKEND_K1: ANY +// Reason: red code + +class UncompilingClass( + val block: (UncompilingClass.() -> Unit)? = null, +) { + + var uncompilingFun: ((T) -> Unit)? = null +} + +fun handleInt(arg: Int) = Unit + +fun box(): String { + val obj = UncompilingClass { + uncompilingFun = { handleInt(it) } + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/issues/kt64066.kt b/compiler/testData/codegen/box/builderInference/issues/kt64066.kt new file mode 100644 index 0000000000000..c81d3ee5ef869 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/issues/kt64066.kt @@ -0,0 +1,13 @@ +// WITH_STDLIB +// ISSUE: KT-64066 +// IGNORE_BACKEND_K1: ANY +// Reason: red code + +fun box(): String { + val map = buildMap { + put(1, 1) + for (v in values) {} + } + if (map[1] != 1) return "FAIL" + return "OK" +} diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.fir.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.fir.kt new file mode 100644 index 0000000000000..bcffd380941db --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.fir.kt @@ -0,0 +1,28 @@ +// ISSUE: KT-52757 +// CHECK_TYPE_WITH_EXACT + +fun test() { + val buildee = build { + typeVariableConsumer = ::consumeTargetType + typeVariableConsumer = {} + } + // exact type equality check — turns unexpected compile-time behavior into red code + // considered to be non-user-reproducible code for the purposes of these tests + checkExactType>(buildee) +} + + + + +class TargetType + +fun consumeTargetType(value: TargetType) {} + +class Buildee { + var typeVariableConsumer: (TV) -> Unit = { storage = it } + private var storage: TV = null!! +} + +fun build(instructions: Buildee.() -> Unit): Buildee { + return Buildee().apply(instructions) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.kt index 98dae0de7e9c5..4eca3f03d1024 100644 --- a/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.kt +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt52757.kt @@ -1,11 +1,10 @@ // ISSUE: KT-52757 -// FIR_IDENTICAL // CHECK_TYPE_WITH_EXACT fun test() { val buildee = build { typeVariableConsumer = ::consumeTargetType - typeVariableConsumer = {} + typeVariableConsumer = {} } // exact type equality check — turns unexpected compile-time behavior into red code // considered to be non-user-reproducible code for the purposes of these tests diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.fir.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.fir.kt new file mode 100644 index 0000000000000..e5a16c5cd8dad --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.fir.kt @@ -0,0 +1,27 @@ +// ISSUE: KT-53109 +// CHECK_TYPE_WITH_EXACT + +fun test() { + val buildee = build { + typeVariableConsumer = { consumeTargetType(it) } + } + // exact type equality check — turns unexpected compile-time behavior into red code + // considered to be non-user-reproducible code for the purposes of these tests + checkExactType>(buildee) +} + + + + +class TargetType + +fun consumeTargetType(value: TargetType) {} + +class Buildee { + var typeVariableConsumer: (TV) -> Unit = { storage = it } + private var storage: TV = null!! +} + +fun build(instructions: Buildee.() -> Unit): Buildee { + return Buildee().apply(instructions) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.kt index e77d4f007b6c3..f71385ae3fa47 100644 --- a/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.kt +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt53109.kt @@ -1,10 +1,9 @@ // ISSUE: KT-53109 -// FIR_IDENTICAL // CHECK_TYPE_WITH_EXACT fun test() { val buildee = build { - typeVariableConsumer = { consumeTargetType(it) } + typeVariableConsumer = { consumeTargetType(it) } } // exact type equality check — turns unexpected compile-time behavior into red code // considered to be non-user-reproducible code for the purposes of these tests diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt53478.fir.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt53478.fir.kt new file mode 100644 index 0000000000000..04229cd743cf7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt53478.fir.kt @@ -0,0 +1,16 @@ +// ISSUE: KT-53478 + +class UncompilingClass( + val block: (UncompilingClass.() -> Unit)? = null, +) { + + var uncompilingFun: ((T) -> Unit)? = null +} + +fun handleInt(arg: Int) = Unit + +fun box() { + val obj = UncompilingClass { + uncompilingFun = { handleInt(it) } + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt new file mode 100644 index 0000000000000..952b0f46edcd4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt @@ -0,0 +1,16 @@ +// ISSUE: KT-53478 + +class UncompilingClass( + val block: (UncompilingClass.() -> Unit)? = null, +) { + + var uncompilingFun: ((T) -> Unit)? = null +} + +fun handleInt(arg: Int) = Unit + +fun box() { + val obj = UncompilingClass { + uncompilingFun = { handleInt(it) } + } +} diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt64066.fir.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt64066.fir.kt new file mode 100644 index 0000000000000..fd03956459767 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt64066.fir.kt @@ -0,0 +1,9 @@ +// WITH_STDLIB +// ISSUE: KT-64066 + +fun box() { + val map = buildMap { + put(1, 1) + for (v in values) {} + } +} diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt new file mode 100644 index 0000000000000..1c44861c87c2e --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt @@ -0,0 +1,9 @@ +// WITH_STDLIB +// ISSUE: KT-64066 + +fun box() { + val map = buildMap { + put(1, 1) + for (v in values) {} + } +} diff --git a/compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt b/compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt new file mode 100644 index 0000000000000..61645dcea099d --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt @@ -0,0 +1,26 @@ +// FIR_IDENTICAL +// WITH_STDLIB +// ISSUE: KT-64066, KT-53478 +// LANGUAGE: +NoBuilderInferenceWithoutAnnotationRestriction + +fun box1() { + val map = buildMap { + put(1, 1) + for (v in values) {} + } +} + +class UncompilingClass( + val block: (UncompilingClass.() -> Unit)? = null, +) { + + var uncompilingFun: ((T) -> Unit)? = null +} + +fun handleInt(arg: Int) = Unit + +fun box2() { + val obj = UncompilingClass { + uncompilingFun = { handleInt(it) } + } +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 7ae63db5aac74..73fd8aabaf039 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -4049,6 +4049,12 @@ public void testKt53422b() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -4235,6 +4241,18 @@ public void testKt63841() { runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt63841.kt"); } + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066.kt"); + } + + @Test + @TestMetadata("kt64066disabled.kt") + public void testKt64066disabled() { + runTest("compiler/testData/diagnostics/tests/builderInference/issues/kt64066disabled.kt"); + } + @Test @TestMetadata("kt64077.kt") public void testKt64077() { 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 d8bd2a08ebb4d..2e61f383a50dc 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 @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 f5e9a837c9759..5dcae98b207b5 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 @@ -3468,6 +3468,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3641,6 +3647,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 70839f1a469c6..ef685e005a820 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 @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 7af20ab648a09..c024b35974da6 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 @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java index 43147b724cee7..fdc51bf4f4151 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java @@ -3666,6 +3666,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3839,6 +3845,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 8a6737b67d636..4a6894564cd30 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -3190,6 +3190,11 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @TestMetadata("kt53553.kt") public void testKt53553() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53553.kt"); @@ -3334,6 +3339,11 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter") 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 2a1222cba30fc..b4d3ddbb1bde1 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 @@ -2754,6 +2754,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2921,6 +2927,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 d36bd9b610247..694a63b3aff9f 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 @@ -2754,6 +2754,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2921,6 +2927,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 af4ec7ca62c76..04d4c42b3823c 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 @@ -2754,6 +2754,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2921,6 +2927,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 df0923d5f6a42..58f4bbdaaaeb6 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 @@ -2754,6 +2754,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2921,6 +2927,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 4866f7ed06042..0ab3b571111e6 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 @@ -2831,6 +2831,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2998,6 +3004,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 cfe97f2e12beb..73d5e69ec65e2 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 @@ -2889,6 +2889,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -3056,6 +3062,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 088f191b60164..b6802260825c9 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 @@ -2773,6 +2773,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2940,6 +2946,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 c6243458eeb38..72bdf851062f6 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 @@ -2832,6 +2832,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2999,6 +3005,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 3086df491e9e3..9dc1ae398b998 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 @@ -2742,6 +2742,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2909,6 +2915,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested 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 07d30db6ff7f1..0e2988ab60cc3 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 @@ -2742,6 +2742,12 @@ public void testKt53422b() { runTest("compiler/testData/codegen/box/builderInference/issues/kt53422b.kt"); } + @Test + @TestMetadata("kt53478.kt") + public void testKt53478() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt53478.kt"); + } + @Test @TestMetadata("kt53553.kt") public void testKt53553() { @@ -2909,6 +2915,12 @@ public void testKt63840b() { public void testKt63840c() { runTest("compiler/testData/codegen/box/builderInference/issues/kt63840c.kt"); } + + @Test + @TestMetadata("kt64066.kt") + public void testKt64066() { + runTest("compiler/testData/codegen/box/builderInference/issues/kt64066.kt"); + } } @Nested