In the specific context of Compose, but a general ...
# announcements
k
In the specific context of Compose, but a general higher level question on nested lambdas. Do you usually ignore this implicit shadowing warning, or do you do something like
{ change -> change.consumeDownChange() }
for the inner block?
n
I don't allow
it
to shadow, pretty much ever
More common to change the outer function but sometimes I would change the inner function, really it just depends. The concise-ness of
it
is nice but not nice enough IMHO to ever allow it as a source of confusion
a
I usually either name the outer
it
or suppress if there's really no opportunity for confusion or ambiguity in the specific case. Inner always gets to keep
it
if any of them do though
(well, "always" - absolute statements for things like this are slippery)
n
wouldn't supressing add as much code as just naming the variable though?
or are you saying just supress in the IDE
a
suppressing at the function or class level adds noise at a place that doesn't harm readability at the actual usage site
d
I’d probably switch to using a method reference.
it.changes.forEach(PointerInputChange::consumeDownChange)