Davide Giuseppe Farella
07/27/2022, 4:28 PMprivate fun isLambda(parameter: KtParameter) = ") -> " in parameter.text
Note that isLambdaParameter
and isFunctionTypeParameter
evaluate the KtParameter
as a parameter of a lambda blockBrais Gabin
07/27/2022, 5:10 PMDavide Giuseppe Farella
07/27/2022, 5:13 PMBrais Gabin
07/27/2022, 6:02 PMFunctionMatcher
. You receive the lambda
as a kotlin.FunctionN
type.Brais Gabin
07/27/2022, 6:02 PMN
can be 0, 1, 2, 3...Davide Giuseppe Farella
07/27/2022, 6:03 PMDavide Giuseppe Farella
07/28/2022, 6:01 AMparam.startsWith("(")
).
Side note: I might misunderstood the use case, but from that function, I noted 2 things:
• It never matches a lambda, as the String would be something like block: () -> Unit
, so it would never start with (
• Does it consider lambda with a receiver? Even matching the type only, it would fail with Scope.() -> Unit
Are these intended, or are they bugs? 🙂Brais Gabin
07/28/2022, 8:06 AMDavide Giuseppe Farella
07/28/2022, 9:49 AM