-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
stat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label
Description
Compiler version
3.1.0
Minimized code
scala> val xs = List(1->10,2->20)
val xs: List[(Int, Int)] = List((1,10), (2,20))
scala> def f(n: Int*) = n.sum
def f(n: Int*): Int
scala> xs.map(f)
-- Error:
1 |xs.map(f)
| ^
| Found: Seq[Int] => Int
| Required: ((Int, Int)) => Int
scala> def g(i: Int, j: Int) = i+j
def g(i: Int, j: Int): Int
scala> xs.map(g)
val res0: List[Int] = List(11, 22)Output
-- Error:Expectation
Adapt the tuple to my repeated parameter.
Implies #14367
A snag is the spec language that "n > 1". The impedance is def f[A](as: A*) because A can be the arbitrary tuple. But that is fine, it just says the adaptation is not needed.
Metadata
Metadata
Assignees
Labels
stat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label