[NI] Add test for obsolete issue
#KT-30858 Obsolete
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// IGNORE_BACKEND: JVM_IR, NATIVE
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
class MyReceiveChannel<out E>
|
||||
interface MyProducerScope<in E>
|
||||
interface MyCoroutineScope
|
||||
|
||||
suspend inline fun <E> MyReceiveChannel<E>.myConsumeEach(action: (E) -> Unit) {}
|
||||
|
||||
suspend fun myDelay(timeMillis: Long) {}
|
||||
|
||||
fun myLaunch(
|
||||
block: suspend MyCoroutineScope.() -> Unit
|
||||
) {}
|
||||
|
||||
@UseExperimental(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
public fun <E> myProduce(@BuilderInference block: suspend MyProducerScope<E>.() -> Unit) {}
|
||||
|
||||
fun <T> MyReceiveChannel<T>.debounce(period: Long) {
|
||||
myProduce {
|
||||
myConsumeEach {
|
||||
myLaunch {
|
||||
myDelay(period)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val m = MyReceiveChannel<String>()
|
||||
m.debounce(42)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user