lilypuchi
08/04/2023, 2:15 AMModifier.composed{}
is not skippable since it has a returns a value. I’m little confused with this 🤔
• Modifier.composed
itself is a non-@Composable function hence it’ll be non-skippable anyways.
• Or is Leland pointing out to the @Composable lambda being non-skippable (which is true
).
Tried looking for the logic that matched what Leland said and the slide in ComposableFunctionBodyTransformer. Would be great if anyone could help clarify this part and if there’s any source to it. 🙇shikasd
08/04/2023, 4:11 AMAlbert Chang
08/04/2023, 4:11 AMmaterialize
API which will expand a composed modifier by executing the composable lambda.
Also I don't understand how this has anything to do with ComposableFunctionBodyTransformer.lilypuchi
08/04/2023, 4:19 AMI don’t understand how this has anything to do with ComposableFunctionBodyTransformer.I was just looking for any hints regarding the skippable fact. ComposableFunctionBodyTransformer has some hints regarding restartable @Composables so I thought if I could find anything there.
// Currently, we make all composable functions restartable by default, unless:
// 1. They are inline
// 2. They have a return value (may get relaxed in the future)
// 3. They are a lambda (we use ComposableLambda<...> class for this instead)
// 4. They are annotated as @NonRestartableComposable
private fun IrFunction.shouldBeRestartable(): Boolean {..}