I'm trying to figure out why multiple `vararg` par...
# getting-started
f
I'm trying to figure out why multiple
vararg
parameters are not allowed even if they have different types
l
vararg
must be the last parameter, so, having 2 of them is not possible as only the latter would really be the last one
f
well you can have a parameter after it if you use the named argument syntax
l
Only when calling the function
But you can’t declare a function having 2 varargs
f
right, but I am wondering why that is
Maybe I am missing something
I understand why its necessary when both varargs have the same type or one is a supertype
but I could pass
1, 2, 3, "bla", "blubb"
to a function with an
Int
and a
String
vararg
sure but couldn't it still be supported for types where it doesn't lead to ambiguity?
just a theoretical question
I see, thanks