compose-rules
compose-rules copied to clipboard
ModifierMissing detected wrongly
Hello,
I have a case where ModifierMissing is being detected incorrectly when function doesn't emit a function.
Example:
// ModifierMissing error because of cellWrapper
@Composable
fun testModifier1() = NumberPadStyle(
size = Size.Scaled,
cellTextStyle = Theme.typography.h2, // requires @Composable
cellWrapper = { cell ->
Text(text = "test", modifier = cell.modifier)
}
)
// no ModifierMissing detected
@Composable
fun testModifier2() = NumberPadStyle(
size = Size.Scaled,
cellTextStyle = Theme.typography.h2, // requires @Composable
)
// no ModifierMissing detected (because not using @Composable)
fun testModifier3() = NumberPadStyle(
size = Size.Scaled,
cellTextStyle = TextStyle(),
cellWrapper = { cell ->
Text(text = "test", modifier = cell.modifier)
}
)
In my case, cellWrapper is a lambda that is composable that emits content, but testModifier1 function itself doesn't emit any content