I am looking for a generalized solution to this problem for any sized number of parameters (well any, I don't mean over 15 parameters realistically) I have a function.
def test(a: String, b: Int): Int = 0
I have a Seq[Any].
val seq: Seq[Any] = Seq("Hi", 5)
How can I call the function test with this seq as the parameters?
Now I tried test(seq:_*)
but that does not work because it does not match the function types, compiler cannot understand which function to use.
Could Scala Macros be useful here?
(You are looking at this and thinking, this is a bad idea, why have a Seq[Any] in the first place? Its bad practice, yes it is, but its a question, I'm not asking if its a good idea or not as I know its not good, I have a Seq[Any] and I start from there with the problem)