Open
Description
launch {
aFlow.collectLatest {
async {
// uses CoroutineScope from launch => not cancelled when collectLatest block is cancelled
}
}
}
It should not be possible to use launch
/async
/etc inside collectLatest {}
(e.g. by means of @DslMarker
) OR the block should get CoroutineScope
receiver.
Easy to forget workaround:
launch {
aFlow.collectLatest {
coroutineScope {
async {
// ...
}
}
}
}