Any help with beta 8 change ? ```@Composable fun l...
# compose
t
Any help with beta 8 change ?
Copy code
@Composable
fun loadIcon(
    applicationInfo: ApplicationInfo?,
): State<ImageBitmap?> {
    val context = LocalContext.current
    return produceState(initialValue = null, applicationInfo) {
        withContext(Dispatchers.Default) {
            value = applicationInfo?.loadIcon(context.packageManager)?.toBitmap()?.asImageBitmap()
        }
    }
}
No more compiles with error
Copy code
Type mismatch: inferred type is ImageBitmap? but Nothing? was expected
I also switched to Kotlin 1.5.10
d
produceState<ImageBitmap>(
. Looks like a bug though.
t
From changelog state variance is now out so maybe there's some expected things to modify, but I must admit that I do not fully master those variance things. But yes forcing the type works thanks.
a
Yes, this case now requires explicit type. See the discussion here: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1621897033329100