Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinFlow cold streamsSingle-choice MCQ

Why does this attempt to emit from a different coroutine inside a `flow { }` builder throw at runtime?

import kotlinx.coroutines.* import kotlinx.coroutines.flow.* val f = flow { coroutineScope { launch { emit(1) } // throws } }