Slackbot
03/09/2026, 11:35 AMmin
03/09/2026, 11:38 AMScaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Column(modifier = Modifier.padding(innerPadding)) {
(@Composable {
Log.d("SCOPE", "depth 0")
var counter by remember { mutableIntStateOf(0) }
val read = counter
(@Composable {
Log.d("SCOPE", "depth 1")
Button(onClick = { counter += 1 }) {}
})()
})()
}
}
This also unconditionally throws. What’s going on?min
03/09/2026, 11:46 AM@Composable fun Do(f: () -> (@Composable () -> Unit)) {
val composable = f(); composable()
}
Do {{
Log.d("SCOPE", "depth 0")
var counter by remember { mutableIntStateOf(0) }
val read0 = counter
Do {{
Log.d("SCOPE", "depth 1")
Button(onClick = { counter += 1 }, modifier = Modifier.padding(innerPadding)) {
Log.d("SCOPE", "depth 2")
Text(counter.toString())
}
}}
}}
This’s fixed it. Is this a bug in Jetpack Compose?