From 498a7ace941aab73ec19dad15e2efb03f09add78 Mon Sep 17 00:00:00 2001 From: Simon Marquis Date: Thu, 25 Jan 2024 11:01:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Type=20inference=20cannot=20reso?= =?UTF-8?q?lve=20nullable=20@Composable=20lambda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://youtrack.jetbrains.com/issue/KT-64706 --- .../configurator/samples/textfields/TextFieldsConfigurator.kt | 4 ++-- .../kotlin/com/adevinta/spark/catalog/themes/ThemePicker.kt | 2 +- .../kotlin/com/adevinta/spark/components/menu/DropdownMenu.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/catalog/src/main/kotlin/com/adevinta/spark/catalog/configurator/samples/textfields/TextFieldsConfigurator.kt b/catalog/src/main/kotlin/com/adevinta/spark/catalog/configurator/samples/textfields/TextFieldsConfigurator.kt index c40b8afc7..b767b353a 100644 --- a/catalog/src/main/kotlin/com/adevinta/spark/catalog/configurator/samples/textfields/TextFieldsConfigurator.kt +++ b/catalog/src/main/kotlin/com/adevinta/spark/catalog/configurator/samples/textfields/TextFieldsConfigurator.kt @@ -101,8 +101,8 @@ private fun TextFieldSample() { label = labelText, placeholder = placeHolderText, helper = helperText, - leadingContent = addonText?.let { { Text(it) } }, - trailingContent = icon?.let { { Icon(it, contentDescription = null) } }, + leadingContent = addonText?.let { { Text(it) } } ?: {}, + trailingContent = icon?.let { { Icon(it, contentDescription = null) } } ?: {}, state = state, stateMessage = stateMessageText, ) diff --git a/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/ThemePicker.kt b/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/ThemePicker.kt index 9d548871c..02d47b4c1 100644 --- a/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/ThemePicker.kt +++ b/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/ThemePicker.kt @@ -142,7 +142,7 @@ public fun ThemePicker( text = { Text(text = brand.name) }, - trailingIcon = if (brand == theme.brandMode) selectedIcon else null, + trailingIcon = if (brand == theme.brandMode) selectedIcon else {{}}, onClick = { onThemeChange(theme.copy(brandMode = brand)) expanded = false diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/menu/DropdownMenu.kt b/spark/src/main/kotlin/com/adevinta/spark/components/menu/DropdownMenu.kt index 63f5b0a79..8e7deb455 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/menu/DropdownMenu.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/menu/DropdownMenu.kt @@ -145,8 +145,8 @@ public fun DropdownMenuItem( text: @Composable () -> Unit, onClick: () -> Unit, modifier: Modifier = Modifier, - leadingIcon: @Composable (() -> Unit)? = null, - trailingIcon: @Composable (() -> Unit)? = null, + leadingIcon: @Composable (() -> Unit) = {}, + trailingIcon: @Composable (() -> Unit) = {}, enabled: Boolean = true, colors: MenuItemColors = MenuDefaults.itemColors(), contentPadding: PaddingValues = MenuDefaults.DropdownMenuItemContentPadding,