Hi. Can someone help me understanding why IntelliJ...
# intellij
h
Hi. Can someone help me understanding why IntelliJ does not show the names of the parameters when calling a lambda returned from another function? In this instance i would expect the intellisense to say “country: String” instead of just "String”
m
The Lambda only has a type as it’s a functional interface. At least I think that’s what is happening here. It can only show names for ‘real’ function calls, and not calls to a Lambda interface. I suspect it doesn’t carry parameter names around because the fact you called it
country
in your usage isn’t required. By default, it would just be
it
.
h
@Mike aren’t you confusing it with a function/lambda that is passed as a parameter?
If i give the returned function two parameters, intellisense says “String, String”
a
I'm pretty sure he isn't confusing it. You also don't get the hint if you declare a lambda yourself
I think you can specify the type with parameters though @herlevsen
So yea, it's just that it could only infer the return type to be
(String) -> Unit
h
It was more the point of it being “it” by default
Well yeah, can’t argue with that, but I don’t understand why though. Would it be Kotlin or IntelliJ that cannot infer it? Then I might submit a feature request
a
I think kotlin, but I don't know