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) + }