【发布时间】:2022-11-04 16:10:29
【问题描述】:
我可以有
val composeFunction = remember { mutableStateOf ({}) }
我可以有
val composeFF = @Composable { Text("ABC") }
val composeFunction = remember { mutableStateOf (composeFF) }
为什么我不能
val composeFunction = remember { mutableStateOf (@Composable { Text("ABC") }) }
它出错了状态
Internal Error occurred while analyzing this expression
(Please use the "
" icon in the bottom-right corner to report this error):
jar:file:/Applications/Android%20Studio.app/Contents/lib/platform-impl.jar!/general/error.svg
Type inference failed. Expected type mismatch: inferred type is @Composable () -> Unit but () -> Unit was expected
【问题讨论】:
标签: android function kotlin android-jetpack-compose kotlin-function-type