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

Paul Woitaschek

10/27/2020, 2:52 PM
Coroutines Riddle: What happens when you execute this with coroutines 1.4.0?
Copy code
inline class A(val value: String)

fun main() {
    runBlocking {
        val aFlow = flowOf(A("Hello"))
        combine(aFlow, aFlow) { a, b ->
            a to b
        }.toList()
    }
}
t

tseisel

10/27/2020, 3:31 PM
I have
java.lang.ClassCastException: A cannot be cast to java.lang.String
... probably an issue with boxed inline classes
m

Marcelo Hernandez

10/27/2020, 11:33 PM
It no longer crashes on certain Android 7 devices? 😆 🤷‍♂️
I guess I was referring to usage of `combine`; not the actual usage of
fun main
🙂
p

Paul Woitaschek

10/28/2020, 8:34 AM
@Marcelo Hernandez Ha, that was my issue 😍
😄 1
m

Marcelo Hernandez

10/30/2020, 11:27 PM
5 Views