groostav
07/23/2018, 7:51 AMselect {}
will simply abandon your coroutine?
@Test fun `using an empty select clause just abandons you`() = runBlocking {
val producer = produce<String> {
select<String> {
val x = 4;
}
val y = 4;
}
val result = producer.receiveOrNull()
val z = 4;
}
never completeselizarov
07/23/2018, 8:06 AMselect {}
(without clauses) will never resume. Just like suspendCoroutine {}
. Conceptually, just like while (true) {}
.elizarov
07/23/2018, 8:07 AMgroostav
07/23/2018, 8:10 AMregisterSelectClause
implementations, then throw an exception if that flag is not set?groostav
07/23/2018, 8:11 AMjava.lang.ClassCastException: ...ProducerCoroutine cannot be cast to ...SelectClause1
from a fairly innocuous code, i just reduced it a little, should I submit this to kotlinx.coroutines or youtrack/KT?groostav
07/23/2018, 8:13 AMelizarov
07/23/2018, 8:30 AMgroostav
07/23/2018, 8:32 AM