Scala varargs to Java varargs

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Scala varargs to Java varargs

Christos KK Loverdos
Motivated by previous threads regarding varargs in two different contexts

I have hacked this conversion from Scala varargs to Java varagrs:

def g(x: Any*) =

This can be used for instance for a java method with the following
varargs declaration:

void doStuff(Object ...args)

It smells like compiler stuff and I was wondering whether the
compiler, since it knows what it is doing, could do the transformation
itself. Just wondering as I said, I have not considered the possible
implications and/or viability of such a scheme.


 -\ <, Christos KK Loverdos
(*)/ (*)