Alexander Maryanovsky
12/12/2022, 5:47 PM@Composable
lambda/local function in a variable.
@Composable
fun myFun(){ ... }
val tooltipContent = if (condition) null else ::myFun
fails because Function References of @Composable functions are not currently supported
and
val tooltipContent = if (condition) null else (@Composable{ ... })
crashes the compiler with
java.lang.IllegalStateException: NO_EXPECTED_TYPE
Alexander Maryanovsky
12/12/2022, 6:32 PMfun myFun() = @Composable{ ... }
val tooltipContent = if (condition) null else myFun()