Got an exception during compilation. Does this (er...
# compiler
a
Got an exception during compilation. Does this (error message in thread) look like it’s enough to submit a bug report, or should I try to get a small reproduction sample?
Ah, it doesn’t fit in Slack. Here’s a file:
y
I think you most likely need a reproducer here sadly. IR errors are sometimes too generic lol.
a
Bummer. I’ll try
Got it.
Copy code
inline fun <reified T, R> combineFlows(
    properties: Iterable<Flow<T>>,
    crossinline transform: (Array<T>) -> R
): Flow<R> {
    return combine(properties, transform)
}

val sumFlow: Flow<Int> = combineFlows(listOf<StateFlow<Int>>(), Array<Int>::sum)
Ah, I think I even got the culprit:
Copy code
inline fun foo(crossinline func: suspend () -> Int) = runBlocking { func() }

inline fun foobar(crossinline func: () -> Int) = foo(func)

val x = foobar{ 5 }
It’s passing a non-suspend function as a suspend function to an inline function.