Hi all,
I’m studying scala Language Specificaton, version 2.11 .
I’m trying to declare a tuple using the “Repeated parameter” as wrotten in chapter 4.6.3, of SLS:
I tried on my own to declare a tuple in this way, but I can’t figure out, where I’m wrong, because it don’t works !
In the chapter above, it says:
“That is, if a method m with type (p1:T1,…,pn:Tn,ps:S
*)U
`` is applied to arguments (e1,…,ek) where k≥n, then m is taken in that application to have type (p1:T1,…,pn:Tn,ps:S,…,ps′S)U, with k−n occurrences of type S where any parameter names beyond ps are fresh”
So I’m trying to type:
val Tuple (x1 : Int ..., x5 : String ..., x8 : Float) = (e1... , e10);
And, it don’t works.
Which is the correct syntax to declare this kind of tuple?
Thank you