Skip to content

Commit 8d7a18f

Browse files
committed
Partially revert "Bump Kotlin to 2.0.0 and Compose Multiplatform to 1.6.10", reverting its changes in CommonSnackbar
This partially reverts commit a2aa9c7. This seems to be caused by a compiler bug in Kotlin 2.0.0 and it seems fixed now in Kotlin 2.1.0.
1 parent 424d72a commit 8d7a18f

File tree

1 file changed

+5
-4
lines changed
  • material2/src/jsMain/kotlin/com/huanshankeji/compose/material2

1 file changed

+5
-4
lines changed

material2/src/jsMain/kotlin/com/huanshankeji/compose/material2/Snackbar.js.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable
44
import com.huanshankeji.compose.ui.Modifier
55
import com.huanshankeji.compose.ui.toAttrs
66
import dev.petuska.kmdc.core.MDCAttrs
7+
import dev.petuska.kmdc.core.MDCContent
78
import dev.petuska.kmdc.snackbar.*
89

910
private fun Boolean.actionOnNewLineToType() =
@@ -17,13 +18,13 @@ internal fun CommonSnackbar(
1718
timeoutMs: Int?,
1819
modifier: Modifier,
1920
attrs: MDCAttrs<MDCSnackbarAttrsScope>?,
20-
mdcSnackbarContent: @Composable MDCSnackbarScope.() -> Unit?, // `MDCContent<MDCSnackbarScope>?` not working here since Kotlin 2.0.0
21-
actions: @Composable MDCSnackbarActionsScope.() -> Unit?, //MDCContent<MDCSnackbarActionsScope>?,
21+
mdcSnackbarContent: MDCContent<MDCSnackbarScope>?,
22+
actions: MDCContent<MDCSnackbarActionsScope>?,
2223
) =
2324
MDCSnackbar(actionOnNewLine.actionOnNewLineToType(), open, timeoutMs, attrs = modifier.toAttrs(attrs)) {
24-
mdcSnackbarContent.invoke(this)
25+
mdcSnackbarContent?.invoke(this)
2526

26-
actions.let {
27+
actions?.let {
2728
Actions {
2829
it()
2930
}

0 commit comments

Comments
 (0)