Trying to put a nullable `@Composable` lambda/loca...
# compiler
a
Trying to put a nullable
@Composable
lambda/local function in a variable.
Copy code
@Composable
fun myFun(){ ... }
val tooltipContent = if (condition) null else ::myFun
fails because
Function References of @Composable functions are not currently supported
and
Copy code
val tooltipContent = if (condition) null else (@Composable{ ... })
crashes the compiler with
Copy code
java.lang.IllegalStateException: NO_EXPECTED_TYPE
Ended up with
Copy code
fun myFun() = @Composable{ ... }
val tooltipContent = if (condition) null else myFun()