Ideally, we'd like to support functions of arbitrary arity in Kotlin. In practice, a JVM method cannot have more that 255 parameters, so this is the limit for us as well.
But... vararg... from JVM's point of view is a single argument....
k
karelpeeters
07/26/2018, 7:44 PM
Or autogenerate classes to wrap multiple arguments in. The possibilities are endless!
j
josephivie
07/26/2018, 7:46 PM
I can just imagine a library with a function called
everything
where every argument is of type
Any?
that literally does all of the functionality of the entire library depending on how it's called.
It will haunt my nightmares.
k
karelpeeters
07/26/2018, 7:49 PM
Was there actually any need for this change? I see the theoretical elegance, but has anyone ever filed an issue "I need 23 parameters"?
s
stanislav.erokhin
07/26/2018, 7:51 PM
When you generate code sometime such situations came out.
๐ 1
o
orangy
07/26/2018, 8:09 PM
@josephivie thatโs basically how JavaScript works ๐