Pihentagy
11/27/2026, 10:18 AMit in nested lambdas: our AI review keeps flagging this, and I think the rule is too strict.
The official conventions (https://kotlinlang.org/docs/coding-conventions.html#lambda-parameters), which our guidelines adopt verbatim, say: “In nested lambdas with parameters, always declare parameters explicitly.” So the reviewer flags code like this:
labels.any { label -> wantedLabels.any { it in label.name } }
and wants this instead:
labels.any { label -> wantedLabels.any { keyword -> keyword in label.name } }
But it isn’t ambiguous here: the outer lambda names its parameter, so it can only mean one thing. The extra name adds nothing.
Proposal: add an exception to our KOTLIN_CODING_GUIDELINES.md: a nested lambda may use it as long as no enclosing lambda uses it. So this is still not OK:
orders.filter { it.items.any { it.price > limit } }
Objections?CLOVIS
11/27/2026, 10:54 AMlabels.any { label -> wantedLabels.any { it in label.name } }
This is too verbose I think:
labels.any { label -> wantedLabels.any { keyword -> keyword in label.name } }
This is too confusing I think:
orders.filter { it.items.any { it.price > limit } }Pihentagy
11/27/2026, 12:45 PMCLOVIS
11/28/2026, 11:59 AM