[NI] Builder-inference: fix unresolved reference for variable calls
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !USE_EXPERIMENTAL: kotlin.Experimental
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface ProducerScope<E> {
|
||||
fun yield(e: E)
|
||||
}
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <E> produce(@BuilderInference block: ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO()
|
||||
|
||||
fun <K> filter(e: K, predicate: (K) -> Boolean) =
|
||||
produce {
|
||||
predicate(e)
|
||||
yield(42)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope<kotlin.Int>
|
||||
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E>
|
||||
|
||||
public interface ProducerScope</*0*/ E> {
|
||||
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 abstract fun yield(/*0*/ e: E): kotlin.Unit
|
||||
}
|
||||
Reference in New Issue
Block a user