Hey,
I'm building an Mpp project and I've faced an issue with method references when compiling an iOS app.
// Kotlin version: 1.3.31
abstract class CachingRepository<K, V> {
suspend fun cache(getNew: suspend () -> List<Pair<K, V>>)
}
class ChannelsRepository: CachingRepository<Int, Channel> {
suspend fun getAllChannelsFromApi(): List<Pair<Int, Channel>>
}
cache(::getAllChannelsFromApi)
// This ^ Breaks native compilation for presets.iosX64 platform with:
// Type mismatch: inferred type is KSuspendFunction0<List<Pair<Int, Channel>>> but suspend () -> List<Pair<Int, Channel>> was expected
cache(suspend { getAllChannelsFromApi() }) // < This works just fine
When compiling for JVM everything works fine. I'm not really sure what else could be useful for reproduction of this bug, so let me know if I could be of any help.
Hey, I'm building an Mpp project and I've faced an issue with method references when compiling an iOS app.
When compiling for JVM everything works fine. I'm not really sure what else could be useful for reproduction of this bug, so let me know if I could be of any help.