diff --git a/redwood-compose/src/commonMain/kotlin/app/cash/redwood/compose/WidgetApplier.kt b/redwood-compose/src/commonMain/kotlin/app/cash/redwood/compose/WidgetApplier.kt index e7b209c748..17db89fb0a 100644 --- a/redwood-compose/src/commonMain/kotlin/app/cash/redwood/compose/WidgetApplier.kt +++ b/redwood-compose/src/commonMain/kotlin/app/cash/redwood/compose/WidgetApplier.kt @@ -84,7 +84,6 @@ internal class NodeApplier( // traversing down the tree. This ensures we can add widget nodes to children nodes in // bottom-up order. if (instance is ChildrenNode) { - @Suppress("UNCHECKED_CAST") // Guaranteed by generated code. val widgetNode = current as WidgetNode, W> instance.attachTo(widgetNode.widget) } @@ -96,7 +95,6 @@ internal class NodeApplier( // We only attach widgets to their parent node's children when traversing back up the tree. // This ensures that the initial properties of the widget have been set before it is attached. if (instance is WidgetNode<*, *>) { - @Suppress("UNCHECKED_CAST") // Guaranteed by generated code. val widgetNode = instance as WidgetNode, W> val current = current as ChildrenNode val children = current.children @@ -141,10 +139,10 @@ public sealed interface Node * @suppress For generated code usage only. */ @RedwoodCodegenApi -public class WidgetNode, V : Any>( +public class WidgetNode, V : Any>( private val applier: RedwoodApplier, public val widget: W, -) : Node { +) : Node { public fun recordChanged() { applier.recordChanged(widget) }