[NI] Fix exception on capturing stub type from coroutine-inference

#KT-30853 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-05-06 18:03:20 +03:00
parent 90f11211d3
commit 1fecd15355
5 changed files with 54 additions and 0 deletions
@@ -0,0 +1,19 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental
import kotlin.experimental.ExperimentalTypeInference
suspend fun main() {
iFlow { emit(1) }
}
@UseExperimental(ExperimentalTypeInference::class)
fun <K> iFlow(@BuilderInference block: suspend iFlowCollector<in K>.() -> Unit): iFlow<K> = TODO()
interface iFlowCollector<S> {
suspend fun emit(value: S)
}
interface iFlow<out V>
@@ -0,0 +1,17 @@
package
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ K> iFlow(/*0*/ @kotlin.BuilderInference block: suspend iFlowCollector<in K>.() -> kotlin.Unit): iFlow<K>
public suspend fun main(): kotlin.Unit
public interface iFlow</*0*/ out V> {
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 iFlowCollector</*0*/ S> {
public abstract suspend fun emit(/*0*/ value: S): kotlin.Unit
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
}