Margarita Volodina
01/17/2022, 3:22 PM// there is any nullable computed condition possible
val test: Boolean? = null
test?.let {
println("succeed")
} ?: run {
println("error")
}
test?.let {
Greeting("Android")
} ?: run {
Greeting("ios")
}
For kotlinVersion=1.5.31, composeVersion=1.0.5 works as expected (println("error")
, Greeting("ios")
are called).
For kotlinVersion=1.6.0 (and higher), composeVersion=1.1.0-rc01 composable function after ?:
is never called, even though println("error")
is called.
This behaviour could be easily reproduced for a new project from Android Studio wizard with default compose activity template.
Does anyone have the same problem? Any ideas how to fix this for newer kotlin versions without rewriting code for using if-statements?Adam Powell
01/17/2022, 3:32 PMMargarita Volodina
01/17/2022, 3:40 PM