From 61c337588bcbe3f2f2b43a26f963b5f9431564b8 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 7 Nov 2019 10:41:15 +0300 Subject: [PATCH] Revert testdata accidentally committed in 665405c4 --- .../variableCallInsideBuilderFunction.kt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt index 25a929657b2..17ba9ad9d2f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt @@ -2,6 +2,17 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // !USE_EXPERIMENTAL: kotlin.Experimental -fun test(x: List) { - x + x -} \ No newline at end of file +import kotlin.experimental.ExperimentalTypeInference + +interface ProducerScope { + fun yield(e: E) +} + +@UseExperimental(ExperimentalTypeInference::class) +fun produce(@BuilderInference block: ProducerScope.() -> Unit): ProducerScope = TODO() + +fun filter(e: K, predicate: (K) -> Boolean) = + produce { + predicate(e) + yield(42) + }