From 9cde42e2bcef2a459afb2bc455643232eac32f3b Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 25 Aug 2020 11:56:36 +0300 Subject: [PATCH] [NI] Fix `shouldRunCompletion` for builder inference session #KT-41308 Fixed #KT-41363 --- ...endDiagnosticsTestWithStdlibGenerated.java | 10 +++++++ .../ir/FirBlackBoxCodegenTestGenerated.java | 5 ++++ .../inference/CoroutineInferenceSession.kt | 29 +++++++++++++++++++ .../calls/tower/ResolvedAtomCompleter.kt | 3 +- .../resolve/calls/model/ResolutionAtoms.kt | 4 ++- .../callableReferenceAndCoercionToUnit.kt | 20 +++++++++++++ .../callableReferenceAndCoercionToUnit.kt | 9 ++++++ .../callableReferenceAndCoercionToUnit.txt | 3 ++ .../coroutines/inference/kt35684.kt | 4 +-- .../coroutines/inference/kt41308.fir.fail | 7 +++++ .../coroutines/inference/kt41308.fir.kt | 9 ++++++ .../coroutines/inference/kt41308.kt | 9 ++++++ .../coroutines/inference/kt41308.txt | 3 ++ .../testsWithStdLib/coroutines/kt37309.kt | 2 +- .../DiagnosticsTestWithStdLibGenerated.java | 10 +++++++ ...ticsTestWithStdLibUsingJavacGenerated.java | 10 +++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 5 ++++ .../LightAnalysisModeTestGenerated.java | 5 ++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 5 ++++ .../IrJsCodegenBoxES6TestGenerated.java | 5 ++++ .../IrJsCodegenBoxTestGenerated.java | 5 ++++ .../semantics/JsCodegenBoxTestGenerated.java | 5 ++++ 22 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.txt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.fail create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.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 bfc9cb4241d..6a879fca6f4 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 @@ -1966,6 +1966,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/builderInferenceForMaterializeWithExpectedType.kt"); } + @TestMetadata("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("callableReferenceToASuspendFunction.kt") public void testCallableReferenceToASuspendFunction() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.kt"); @@ -2101,6 +2106,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt"); } + @TestMetadata("kt41308.kt") + public void testKt41308() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.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 d922f0dfe6f..81f34f8f11a 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); 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 eb8081bc799..c8411eed59b 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 @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.resolve.calls.ArgumentTypeResolver import org.jetbrains.kotlin.resolve.calls.components.CompletedCallInfo import org.jetbrains.kotlin.resolve.calls.components.NewConstraintSystemImpl import org.jetbrains.kotlin.resolve.calls.components.PostponedArgumentsAnalyzer +import org.jetbrains.kotlin.resolve.calls.components.stableType import org.jetbrains.kotlin.resolve.calls.context.BasicCallResolutionContext import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor @@ -27,6 +28,7 @@ import org.jetbrains.kotlin.resolve.calls.model.* import org.jetbrains.kotlin.resolve.calls.tower.* import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver +import org.jetbrains.kotlin.resolve.descriptorUtil.hasBuilderInferenceAnnotation import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices @@ -72,6 +74,10 @@ class CoroutineInferenceSession( return subResolvedAtoms?.any { it.hasPostponed() } == true } + if (!candidate.isSuitableForBuilderInference()) { + return true + } + return !storage.notFixedTypeVariables.keys.any { val variable = storage.allTypeVariables[it] val isPostponed = variable != null && variable in storage.postponedTypeVariables @@ -79,6 +85,29 @@ class CoroutineInferenceSession( } || candidate.getSubResolvedAtoms().any { it.hasPostponed() } } + private fun KotlinResolutionCandidate.isSuitableForBuilderInference(): Boolean { + val extensionReceiver = resolvedCall.extensionReceiverArgument + val dispatchReceiver = resolvedCall.dispatchReceiverArgument + return when { + extensionReceiver == null && dispatchReceiver == null -> false + extensionReceiver == null -> true + extensionReceiver.receiver.stableType.containsStubType() -> resolvedCall.candidateDescriptor.hasBuilderInferenceAnnotation() + else -> true + } + } + + private fun KotlinType.containsNotFixedTypeVariable(storage: ConstraintStorage): Boolean { + return this.contains { + it.constructor in storage.notFixedTypeVariables + } + } + + private fun KotlinType.containsStubType(): Boolean { + return this.contains { + it is StubType + } + } + fun addSimpleCall(callExpression: KtExpression) { simpleCommonCalls.add(callExpression) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt index 46c7a7ed709..2c0baea3eb0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt @@ -332,7 +332,7 @@ class ResolvedAtomCompleter( resolvedAtom: ResolvedCallableReferenceAtom ) { val callableCandidate = resolvedAtom.candidate - if (callableCandidate == null) { + if (callableCandidate == null || resolvedAtom.completed) { // todo report meanfull diagnostic here return } @@ -420,6 +420,7 @@ class ResolvedAtomCompleter( ) kotlinToResolvedCallTransformer.runCallCheckers(resolvedCall, topLevelCallCheckerContext) + resolvedAtom.completed = true } private fun ReceiverValue.updateReceiverValue(substitutor: TypeSubstitutor): ReceiverValue { diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionAtoms.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionAtoms.kt index 8032a21e9bd..ab58b62f0cf 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionAtoms.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/ResolutionAtoms.kt @@ -168,6 +168,8 @@ abstract class ResolvedCallableReferenceAtom( var candidate: CallableReferenceCandidate? = null private set + var completed: Boolean = false + fun setAnalyzedResults( candidate: CallableReferenceCandidate?, subResolvedAtoms: List @@ -299,4 +301,4 @@ class PartialCallContainer(val result: PartialCallResolutionResult?) { */ class StubResolvedAtom(val typeVariable: TypeConstructor) : ResolvedAtom() { override val atom: ResolutionAtom? get() = null -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt b/compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt new file mode 100644 index 00000000000..d5f0a8d9f37 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt @@ -0,0 +1,20 @@ +// IGNORE_BACKEND: JS_IR +// IGNORE_BACKEND_FIR: JVM_IR +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION +// WITH_RUNTIME + +@OptIn(ExperimentalStdlibApi::class) +fun test(s: String?): Int { + val list = buildList { + s?.let(::add) + } + return list.size +} + +fun box(): String { + return when (test("hello")) { + 1 -> "OK" + else -> "Error" + } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt new file mode 100644 index 00000000000..3e282efe0d5 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt @@ -0,0 +1,9 @@ +// FIR_IDENTICAL +// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION + +fun test(s: String?) { + val list = buildList { + s?.let(::add) + } + ")!>list +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.txt new file mode 100644 index 00000000000..d867365df78 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.txt @@ -0,0 +1,3 @@ +package + +public fun test(/*0*/ s: kotlin.String?): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt index 98b317b6d2c..f32bcb18d64 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt @@ -21,7 +21,7 @@ fun test_2() { fun test_3() { sequence { yield(materialize()) - materialize() + materialize() } } @@ -32,4 +32,4 @@ interface Inv { fun yield(element: T) } -fun materialize(): Inv = TODO() \ No newline at end of file +fun materialize(): Inv = TODO() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.fail b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.fail new file mode 100644 index 00000000000..274b3d45f29 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.fail @@ -0,0 +1,7 @@ +Failures detected in FirBodyResolveTransformerAdapter, file: /kt41308.fir.kt +Cause: java.lang.RuntimeException: While resolving call R?C|kotlin/sequences/sequence|( = sequence@fun R|kotlin/sequences/SequenceScope|.(): R|kotlin/Unit| { + lval list: R|kotlin/collections/List?| = Null(null) + lval outputList: R|TypeVariable(K)| = R|/list| ?: R?C|kotlin/collections/listOf|() + yieldAll#(R|/outputList|) +} +) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.kt new file mode 100644 index 00000000000..14e081cacc7 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.fir.kt @@ -0,0 +1,9 @@ +// ISSUE: KT-41308 + +fun main() { + sequence { + val list: List? = null + val outputList = ")!>list ?: listOf() + yieldAll(outputList) + } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt new file mode 100644 index 00000000000..14e081cacc7 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt @@ -0,0 +1,9 @@ +// ISSUE: KT-41308 + +fun main() { + sequence { + val list: List? = null + val outputList = ")!>list ?: listOf() + yieldAll(outputList) + } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.txt new file mode 100644 index 00000000000..a9fef69810f --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.txt @@ -0,0 +1,3 @@ +package + +public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt index 79c362d4e5d..f931c6132de 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt @@ -21,4 +21,4 @@ fun main() { } } -class Foo(val notNullProp: String) \ No newline at end of file +class Foo(val notNullProp: String) diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index 71786e4cdef..30c88093144 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -2006,6 +2006,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/builderInferenceForMaterializeWithExpectedType.kt"); } + @TestMetadata("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("callableReferenceToASuspendFunction.kt") public void testCallableReferenceToASuspendFunction() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.kt"); @@ -2141,6 +2146,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt"); } + @TestMetadata("kt41308.kt") + public void testKt41308() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.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 21e2efa290b..8e73d997313 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -2006,6 +2006,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/builderInferenceForMaterializeWithExpectedType.kt"); } + @TestMetadata("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("callableReferenceToASuspendFunction.kt") public void testCallableReferenceToASuspendFunction() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.kt"); @@ -2141,6 +2146,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt"); } + @TestMetadata("kt41308.kt") + public void testKt41308() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.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 6fe8873c215..243aee6c85e 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 6c4802e5f44..cf2bc21f7c9 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index f943a1a5902..583671af77d 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.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 5ac642811af..0fd1352480f 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.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 6f6c4f84af5..70909b7ecc2 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.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 d01202214b2..719bdb603e4 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("callableReferenceAndCoercionToUnit.kt") + public void testCallableReferenceAndCoercionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt"); + } + @TestMetadata("kt41164.kt") public void testKt41164() throws Exception { runTest("compiler/testData/codegen/box/builderInference/kt41164.kt");