spierce7
03/31/2020, 8:47 PMnative-mt
version of kotlinx.coroutines. I’ve been stuck on this for a while now. Can anyone point me in the right direction for how to fix this?
It’s throwing an error on the emit(defaultValue)
.
Caused by: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.flow.internal.SafeCollector@f506be8
return flow {
var isEmpty = true
emitAll(
abTestRepository.getExperiments(
appName = appName,
userIdentifier = userIdentifier,
experiments = experiments,
mode = mode
)
.onEach { isEmpty = false }
.onCompletion {
if (isEmpty) {
val defaultData = RallyAbTest.data.experiments.map {
ExperimentGroup(
name = it.name,
value = it.defaultGroup
)
}.freeze()
emit(defaultData)
}
}
)
}
Kris Wong
03/31/2020, 8:56 PMnative-mt
version of coroutines?spierce7
03/31/2020, 8:58 PMnative-mt
version of coroutines.Kris Wong
03/31/2020, 9:00 PM