1.1 allows `_` for unused parameters of lambda exp...
# announcements
n
1.1 allows
_
for unused parameters of lambda expressions (and it seems also for unused values in a destructive assignments). Why does that not also work for unused parameters of methods? e.g.
fun main(_: Array<String>) {
l
nkiesel: because that looks ugly 😉
n
hey, beauty is in the eye of the beholder! but really, the intent was the same as in the other usages of `_`: signal the body that we do not want to use this value. But I guess the "what about named parameters?" point means this idea is officially dead.
o
I tested giving different names to parameters when overriding a method, and indeed IDEA gives a warning. But then I tested calling the method, both through a superclass reference and through a subclass reference. And while I did have to change the name of the named argument when calling each of them, I really didn't see it as a big problem. So I'm wondering what issues it may cause...?
n
I guess the problem is that I should be able to call an overridden method using the same parameter name as when calling the base class method. So in this sense, the parameter name (and not only the type and position) is part of the Kotlin method signature