Ernestas
02/16/2026, 10:40 AMOptIn annotation seems to propagate the warning anyway, is this a bug? Example:
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CustomModalBottomSheet(
<...>
) {
androidx.compose.material3.ModalBottomSheet(...)
}
@Preview
@Composable
private fun Preview() {
CustomModalBottomSheet(...) <--- This throws an error, expecting @OptIn too
}
In an Android-only project this works fine, in a multiplatform project this doesn't build and throws errors.
agp = "9.0.1"
kotlin = "2.3.10"CLOVIS
02/16/2026, 11:01 AMErnestas
02/16/2026, 3:05 PMCLOVIS
02/17/2026, 8:21 AM@OptIn on the Preview function too.Ernestas
02/17/2026, 8:35 AM