Fyi, if anyone is using code similar to this: ```...
# compose
l
Fyi, if anyone is using code similar to this:
Copy code
condition?.let {
 //some composable
} ?: //other composable
In 1.1.0-beta04 this will not work correctly and the second condition will never be evaluated/displayed. It works correctly in previous versions (such as 1.0.5). Just wanted to mention it since it caught us out!
z
Can you share a little more repro code? This sounds like a pretty serious bug
l
@Zach Klippenstein (he/him) [MOD] Sure, in a new compose app: This displays nothing in version 1.1.0-beta04 but displays "SECOND" in 1.0.5
Copy code
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            MyApplicationTheme {
                // A surface container using the 'background' color from the theme
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colors.background
                ) {
                    Greeting(null)
                }
            }
        }
    }
}

@Composable
fun Greeting(name: String?) {
    name?.let {
        Text(text = "FIRST")
    } ?: Text(text = "SECOND")
}
Strangely enough, it works if you replace the
let
with
also
c