Skip to content

Can't select correct overloaded method with varargs and Seq #9050

Closed
@Arthurm1

Description

@Arthurm1

Using Scastie - this compiles on Scala 2.13.2 but not Dotty (0.24.0-RC1)

Minimized code

object Foo {
  val foo = scala.collection.mutable.ArrayBuffer.empty[Seq[Double]]
  val bar = Seq.empty[Double]
  foo.append(bar)
}

Output

cannot merge
  method append in trait Buffer of type (elems: A*): (Buffer.this : scala.collection.mutable.Buffer[A])  and
  method append in trait Buffer of type (elem: A): (Buffer.this : scala.collection.mutable.Buffer[A])
they are both defined in trait Buffer but have matching signatures
  (elems: Seq[Double]*): 
  (Foo.foo : scala.collection.mutable.ArrayBuffer[Seq[Double]]) and
  (elem: Seq[Double]): 
  (Foo.foo : scala.collection.mutable.ArrayBuffer[Seq[Double]])
as members of value foo

Expectation

For Dotty to pick the non-varargs method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions