From e98cbf81cff63370d1e658dfb5cb984ce298c857 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 20 Aug 2020 15:04:52 +0300 Subject: [PATCH] [NI] Don't always complete builder inference lambda in FULL mode #KT-41164 Fixed --- ...endDiagnosticsTestWithStdlibGenerated.java | 5 ++++ .../ir/FirBlackBoxCodegenTestGenerated.java | 5 ++++ .../DelegatedPropertyInferenceSession.kt | 2 ++ .../inference/CoroutineInferenceSession.kt | 4 ++- .../calls/tower/ManyCandidatesResolver.kt | 11 +++++--- .../calls/components/InferenceSession.kt | 4 ++- .../calls/components/KotlinCallCompleter.kt | 3 +++ .../components/PostponedArgumentsAnalyzer.kt | 21 +++++++++++++--- .../KotlinConstraintSystemCompleter.kt | 3 ++- .../codegen/box/builderInference/kt41164.kt | 24 ++++++++++++++++++ .../coroutines/inference/kt41164.fir.kt | 25 +++++++++++++++++++ .../coroutines/inference/kt41164.kt | 25 +++++++++++++++++++ .../coroutines/inference/kt41164.txt | 19 ++++++++++++++ .../DiagnosticsTestWithStdLibGenerated.java | 5 ++++ ...ticsTestWithStdLibUsingJavacGenerated.java | 5 ++++ .../codegen/BlackBoxCodegenTestGenerated.java | 5 ++++ .../LightAnalysisModeTestGenerated.java | 5 ++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 5 ++++ .../IrJsCodegenBoxES6TestGenerated.java | 5 ++++ .../IrJsCodegenBoxTestGenerated.java | 5 ++++ .../semantics/JsCodegenBoxTestGenerated.java | 5 ++++ 21 files changed, 181 insertions(+), 10 deletions(-) create mode 100644 compiler/testData/codegen/box/builderInference/kt41164.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java index f4bcfdb6bc4..bfc9cb4241d 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirOldFrontendDiagnosticsTestWithStdlibGenerated.java @@ -2096,6 +2096,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt"); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt"); + } + @TestMetadata("nestedLambdaInferenceWithListMap.kt") public void testNestedLambdaInferenceWithListMap() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt"); diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index d432392e31d..d922f0dfe6f 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -1708,6 +1708,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyInferenceSession.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyInferenceSession.kt index ea51ef37666..3a99e5bdaa3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyInferenceSession.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyInferenceSession.kt @@ -82,6 +82,7 @@ class DelegatedPropertyInferenceSession( override fun inferPostponedVariables( lambda: ResolvedLambdaAtom, initialStorage: ConstraintStorage, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticsHolder: KotlinDiagnosticsHolder ): Map = emptyMap() @@ -103,6 +104,7 @@ class InferenceSessionForExistingCandidates(private val resolveReceiverIndepende override fun inferPostponedVariables( lambda: ResolvedLambdaAtom, initialStorage: ConstraintStorage, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticsHolder: KotlinDiagnosticsHolder ): Map = emptyMap() diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt index 1b121a2009b..eb8081bc799 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt @@ -147,7 +147,8 @@ class CoroutineInferenceSession( override fun inferPostponedVariables( lambda: ResolvedLambdaAtom, initialStorage: ConstraintStorage, - diagnosticsHolder: KotlinDiagnosticsHolder + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, + diagnosticsHolder: KotlinDiagnosticsHolder, ): Map? { val (commonSystem, effectivelyEmptyConstraintSystem) = buildCommonSystem(initialStorage) if (effectivelyEmptyConstraintSystem) { @@ -160,6 +161,7 @@ class CoroutineInferenceSession( context, builtIns.unitType, partiallyResolvedCallsInfo.map { it.callResolutionResult.resultCallAtom }, + completionMode, diagnosticsHolder ) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt index ece60cf7800..f71a76bad83 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt @@ -81,15 +81,20 @@ abstract class ManyCandidatesResolver( } fun runCompletion(constraintSystem: NewConstraintSystem, atoms: List) { + val completionMode = KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode.FULL kotlinConstraintSystemCompleter.runCompletion( constraintSystem.asConstraintSystemCompleterContext(), - KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode.FULL, + completionMode, atoms, builtIns.unitType, diagnosticHolder ) { postponedArgumentsAnalyzer.analyze( - constraintSystem.asPostponedArgumentsAnalyzerContext(), resolutionCallbacks, it, diagnosticHolder + constraintSystem.asPostponedArgumentsAnalyzerContext(), + resolutionCallbacks, + it, + completionMode, + diagnosticHolder ) } @@ -197,4 +202,4 @@ class PSICompletedCallInfo( class PSIErrorCallInfo( override val callResolutionResult: CallResolutionResult, val result: OverloadResolutionResults -) : ErrorCallInfo \ No newline at end of file +) : ErrorCallInfo diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/InferenceSession.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/InferenceSession.kt index fdd44643f4c..12115402fdf 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/InferenceSession.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/InferenceSession.kt @@ -22,6 +22,7 @@ interface InferenceSession { override fun inferPostponedVariables( lambda: ResolvedLambdaAtom, initialStorage: ConstraintStorage, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticsHolder: KotlinDiagnosticsHolder ): Map = emptyMap() @@ -44,6 +45,7 @@ interface InferenceSession { fun inferPostponedVariables( lambda: ResolvedLambdaAtom, initialStorage: ConstraintStorage, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticsHolder: KotlinDiagnosticsHolder ): Map? @@ -64,4 +66,4 @@ interface CompletedCallInfo { interface ErrorCallInfo { val callResolutionResult: CallResolutionResult -} \ No newline at end of file +} diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt index 43b884e7d12..dc6d8035c77 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/KotlinCallCompleter.kt @@ -115,6 +115,7 @@ class KotlinCallCompleter( firstCandidate.getSystem().asPostponedArgumentsAnalyzerContext(), resolutionCallbacks, firstAtom, + ConstraintSystemCompletionMode.FULL, diagnosticHolderForLambda, ) @@ -124,6 +125,7 @@ class KotlinCallCompleter( candidate.getSystem().asPostponedArgumentsAnalyzerContext(), atom, results, + ConstraintSystemCompletionMode.FULL, diagnosticHolderForLambda ) } @@ -228,6 +230,7 @@ class KotlinCallCompleter( constraintSystem.asPostponedArgumentsAnalyzerContext(), resolutionCallbacks, it, + completionMode, diagnosticsHolder ) } diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponedArgumentsAnalyzer.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponedArgumentsAnalyzer.kt index bd7e2d665db..557e6efe579 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponedArgumentsAnalyzer.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/PostponedArgumentsAnalyzer.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.annotations.FilteredAnnotations import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder import org.jetbrains.kotlin.resolve.calls.inference.addSubsystemFromArgument +import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutorByConstructorMap import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage import org.jetbrains.kotlin.resolve.calls.inference.model.CoroutinePosition @@ -47,15 +48,20 @@ class PostponedArgumentsAnalyzer( c: Context, resolutionCallbacks: KotlinResolutionCallbacks, argument: ResolvedAtom, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticsHolder: KotlinDiagnosticsHolder ) { when (argument) { is ResolvedLambdaAtom -> - analyzeLambda(c, resolutionCallbacks, argument, diagnosticsHolder) + analyzeLambda(c, resolutionCallbacks, argument, completionMode, diagnosticsHolder) is LambdaWithTypeVariableAsExpectedTypeAtom -> analyzeLambda( - c, resolutionCallbacks, argument.transformToResolvedLambda(c.getBuilder(), diagnosticsHolder), diagnosticsHolder + c, + resolutionCallbacks, + argument.transformToResolvedLambda(c.getBuilder(), diagnosticsHolder), + completionMode, + diagnosticsHolder ) is ResolvedCallableReferenceAtom -> @@ -84,6 +90,7 @@ class PostponedArgumentsAnalyzer( c: Context, resolutionCallbacks: KotlinResolutionCallbacks, lambda: ResolvedLambdaAtom, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticHolder: KotlinDiagnosticsHolder, ): ReturnArgumentsAnalysisResult { val substitutorAndStubsForLambdaAnalysis = c.createSubstituteFunctorForLambdaAnalysis() @@ -142,7 +149,7 @@ class PostponedArgumentsAnalyzer( convertedAnnotations ?: Annotations.EMPTY, substitutorAndStubsForLambdaAnalysis.stubsForPostponedVariables.cast(), ) - applyResultsOfAnalyzedLambdaToCandidateSystem(c, lambda, returnArgumentsAnalysisResult, diagnosticHolder, substitute) + applyResultsOfAnalyzedLambdaToCandidateSystem(c, lambda, returnArgumentsAnalysisResult, completionMode, diagnosticHolder, substitute) return returnArgumentsAnalysisResult } @@ -150,6 +157,7 @@ class PostponedArgumentsAnalyzer( c: Context, lambda: ResolvedLambdaAtom, returnArgumentsAnalysisResult: ReturnArgumentsAnalysisResult, + completionMode: KotlinConstraintSystemCompleter.ConstraintSystemCompletionMode, diagnosticHolder: KotlinDiagnosticsHolder, substitute: (KotlinType) -> UnwrappedType = c.createSubstituteFunctorForLambdaAnalysis().substitute ) { @@ -191,7 +199,12 @@ class PostponedArgumentsAnalyzer( if (inferenceSession != null && lambda.atom.hasBuilderInferenceAnnotation) { val storageSnapshot = c.getBuilder().currentStorage() - val postponedVariables = inferenceSession.inferPostponedVariables(lambda, storageSnapshot, diagnosticHolder) + val postponedVariables = inferenceSession.inferPostponedVariables( + lambda, + storageSnapshot, + completionMode, + diagnosticHolder + ) if (postponedVariables == null) { c.getBuilder().removePostponedVariables() return diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt index 58132260364..247570a0459 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt @@ -73,10 +73,11 @@ class KotlinConstraintSystemCompleter( c: Context, topLevelType: UnwrappedType, topLevelAtoms: List, + completionMode: ConstraintSystemCompletionMode, diagnosticsHolder: KotlinDiagnosticsHolder ) { c.runCompletion( - ConstraintSystemCompletionMode.FULL, + completionMode, topLevelAtoms, topLevelType, diagnosticsHolder, diff --git a/compiler/testData/codegen/box/builderInference/kt41164.kt b/compiler/testData/codegen/box/builderInference/kt41164.kt new file mode 100644 index 00000000000..3e25aab88c3 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/kt41164.kt @@ -0,0 +1,24 @@ +// ISSUE: KT-41164 +// WITH_RUNTIME + +import kotlin.experimental.ExperimentalTypeInference + +interface MyProducerScope +interface MyFlow + +fun select(x: K, y: K): K = x +@OptIn(ExperimentalTypeInference::class) +fun myCallbackFlow(@BuilderInference block: MyProducerScope.() -> Unit): MyFlow = null!! +fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} +fun myEmptyFlow(): MyFlow = null!! + +fun test(): MyFlow { + return select( + myCallbackFlow { + myAwaitClose {} + }, + myEmptyFlow() + ) +} + +fun box(): String = "OK" diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt new file mode 100644 index 00000000000..b4bf46cb122 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt @@ -0,0 +1,25 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_PARAMETER -EXPERIMENTAL_IS_NOT_ENABLED +// ISSUE: KT-41164 + +import kotlin.experimental.ExperimentalTypeInference + +interface MyProducerScope +interface MyFlow + +fun select(x: K, y: K): K = x + +@OptIn(ExperimentalTypeInference::class) +fun myCallbackFlow(@BuilderInference block: MyProducerScope.() -> Unit): MyFlow = null!! + +fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} +fun myEmptyFlow(): MyFlow = null!! + +fun test(): MyFlow { + return select( + ")!>myCallbackFlow , kotlin.Unit>")!>{ + myAwaitClose {} + }, + myEmptyFlow() + ) +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt new file mode 100644 index 00000000000..6b4d88d1478 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt @@ -0,0 +1,25 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_PARAMETER -EXPERIMENTAL_IS_NOT_ENABLED +// ISSUE: KT-41164 + +import kotlin.experimental.ExperimentalTypeInference + +interface MyProducerScope +interface MyFlow + +fun select(x: K, y: K): K = x + +@OptIn(ExperimentalTypeInference::class) +fun myCallbackFlow(@BuilderInference block: MyProducerScope.() -> Unit): MyFlow = null!! + +fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} +fun myEmptyFlow(): MyFlow = null!! + +fun test(): MyFlow { + return select( + ")!>myCallbackFlow .() -> kotlin.Unit")!>{ + myAwaitClose {} + }, + myEmptyFlow() + ) +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt new file mode 100644 index 00000000000..3a88e7890c0 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt @@ -0,0 +1,19 @@ +package + +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myCallbackFlow(/*0*/ @kotlin.BuilderInference block: MyProducerScope.() -> kotlin.Unit): MyFlow +public fun myEmptyFlow(): MyFlow +public fun select(/*0*/ x: K, /*1*/ y: K): K +public fun test(): MyFlow +public fun MyProducerScope<*>.myAwaitClose(/*0*/ block: () -> kotlin.Unit = ...): kotlin.Unit + +public interface MyFlow { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface MyProducerScope { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index 9e643ad5a76..71786e4cdef 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -2136,6 +2136,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt"); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt"); + } + @TestMetadata("nestedLambdaInferenceWithListMap.kt") public void testNestedLambdaInferenceWithListMap() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java index c73448769a2..21e2efa290b 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -2136,6 +2136,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt"); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt"); + } + @TestMetadata("nestedLambdaInferenceWithListMap.kt") public void testNestedLambdaInferenceWithListMap() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index a3d8a6e1043..6fe8873c215 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -1728,6 +1728,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 14ce7373fe8..6c4802e5f44 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -1728,6 +1728,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 579de52fd63..f943a1a5902 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -1708,6 +1708,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 88be8d0a231..5ac642811af 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -1328,6 +1328,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index e60b12007da..6f6c4f84af5 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -1328,6 +1328,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 87120d3385f..d01202214b2 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -1328,6 +1328,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("kt41164.kt") + public void testKt41164() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); + } + @TestMetadata("lackOfNullCheckOnNullableInsideBuild.kt") public void testLackOfNullCheckOnNullableInsideBuild() throws Exception { runTest("compiler/testData/codegen/box/builderInference/lackOfNullCheckOnNullableInsideBuild.kt");