https://kotlinlang.org logo
#coroutines
Title
# coroutines
t

thevery

06/03/2018, 1:37 AM
ok, finally managed to extract minimal sample to demonstrate another dexcount problem with coroutines:
Copy code
package com.thevery.sample.dexcount

import android.support.annotation.Keep
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.launch

class DexCountHelper {

    private val labelsToMark = setOf<String>()
    private val originalState = mapOf<String, MarkedState>()

    enum class MarkedState {
        MARKED_ALL, MARKED_SOME, MARKED_NONE
    }

    @Keep
    fun coroutines() {
        val finalLabelToMark = labelsToMark.filter { lid -> originalState[lid] != MarkedState.MARKED_ALL }

        launch(CommonPool) {
            // +2 methods here :(
            // val finalLabelToMark = labelsToMark.filter { lid -> originalState[lid] != MarkedState.MARKED_ALL }
            println("finalLabelToMark = $finalLabelToMark")
        }
    }
}
v

Vsevolod Tolstopyatov [JB]

06/04/2018, 9:01 AM
It’s not a coroutines problem. See my answer in https://github.com/Kotlin/kotlinx.coroutines/issues/380
t

thevery

06/06/2018, 12:04 PM
Yeah, thank you!
5 Views