Always a bit annoying to have to slap `@Suppress("UnusedReceiverParameter")` on top of a composable ...
s
Always a bit annoying to have to slap
@Suppress("UnusedReceiverParameter")
on top of a composable which I want to be able to emit multiple things inside a column or a row, so I make them extensions on ColumnScope/RowScope, but I am not using that scope in any other way so the code thinks the scope is unused. Is there anything I am missing to make my life a bit easier here? I feel like for Composables in particular, this warning is wrong, as if I am emitting more than 1 composable top-level, then I am actually making use of the scope, despite what the warning says.
👍 1
4
m
Maybe there is a way to suppress this warning at the module level?
s
No because I'd be suppressing all cases of scope being unused, and it's a very good warning in all cases but these specific ones.
m
Valid point. yeah, I think we need an exclusion for the composables here. but, I can't think of a good way to do this.
s
Me neither
s
Well, technically you are not using the scope, unless you use it for compile time checks.
s
I would argue I am in a way using the scope in the sense that I make it impossible to call this composable from other places where this scope isn't there. Also I avoid problems like getting different outcomes from calling it from one call site without the scope vs another call site with a different scope. I know I am not using the scope in the terms that you describe, but the scope being there really is a very meaningful thing.
s
Yeah, that's what I meant by compile-time checks :)
👍 1