Djuro
07/07/2023, 8:55 PMexpect
actual
modifiers
I am following this article. When I define
commonMain
import kotlinx.coroutines.flow.Flow
expect class CommonFlow<T>(flow: Flow<T>): Flow<T>
androidMain
actual class CommonFlow<T> actual constructor(
private val flow: Flow<T>,
) : Flow<T> by flow
I get a compile-time error:
Actual constructor of 'CommonFlow' has no corresponding expected declaration The following declaration is incompatible because parameter types are different:
public constructor CommonFlow<T>(flow: Flow<T>) defined in com.example.quickpark.util.flows.CommonFlow
Any ideas 🤷 ?Djuro
07/08/2023, 3:06 PMkotlinx.coroutines.flow.Flow
is an interface. Problem stems from actual CommonFlow
implementation I got because by accident I imported java.util.concurrent.Flow
which is a class and definitely something I had no intention on using think smart