https://kotlinlang.org logo
#intellij
Title
# intellij
s

simon.vergauwen

06/25/2019, 3:30 PM
Perhaps this is a better channel to ask this question :)
m

Mike

06/26/2019, 11:10 AM
What does that code even do? First, I thought it was invalid, but I see using a Scratch file that it compiles. BUT I don't see what it does, if anything. In example, stringParam isn't available, so the name doesn't do anything. At my call site, the first parameter to the Lambda is still called
it
. Do you see something different? I suspect what you want is all call sites of
example
to change from
Copy code
example {
    it.subString(1)
}
to this automatically?
Copy code
example { stringParam ->
    stringParam.subString(1)
}
If that's ultimately what you're after, I'm not aware of a way to automatically do it.
s

simon.vergauwen

06/26/2019, 11:14 AM
Yes, that's exactly what I am after. The purpose of defining such param names is pure UX. If it's retained in
@Metadata
then IDEs or a lang server can read it out and provide better naming suggestions for auto completion etc.
m

Mike

06/26/2019, 1:03 PM
An interesting idea, and helpful to avoid everything being
it
, and potentially ambiguous.