[NI] Don't try inferring variables for effectively empty system

This commit is contained in:
Mikhail Zarechenskiy
2020-02-25 09:35:09 +03:00
parent fe71d5256c
commit 0b9fc1541d
2 changed files with 50 additions and 11 deletions
@@ -12,7 +12,29 @@ fun test() {
flow {
emit(1)
}.flatMapLatest<Int, Long> {
flow {}
flow {
expectInt(42)
}
}
flow {
emit(1)
}.flatMapLatest<Int, Long> {
flow {
expectInt(42)
hang {
expectInt(0)
}
}
}
flow {
emit(1)
}.flatMap {
if (it == 1)
flow { expectGeneric(42) }
else
flow<Int> {}
}
flow {
@@ -33,6 +55,11 @@ fun test() {
}
}
fun expectInt(i: Int) {}
fun <K> expectGeneric(i: K) {}
suspend inline fun hang(onCancellation: () -> Unit) {}
fun <T> Flow<T>.flatMap(mapper: suspend (T) -> Flow<T>): Flow<T> = TODO()
@OptIn(ExperimentalTypeInference::class)