-
Notifications
You must be signed in to change notification settings - Fork 22
s.c.m.Buffer#append method is ambiguous #11112
Copy link
Copy link
Closed
Description
scala.collection.mutable.Buffer defines two append methods. One is single-arg, the other is var-arg. This means that you cannot call the single-arg version because it is ambiguous with a single-elem var-arg call.
the method definitions:
@`inline` final def append(elem: A): this.type = addOne(elem)
@deprecated("Use appendAll instead", "2.13.0")
@`inline` final def append(elems: A*): this.type = addAll(elems)an example error:
[error] /Users/joshlemer/IdeaProjects/scala2/src/library/scala/collection/immutable/ChampHashSet.scala:831: ambiguous reference to overloaded definition,
[error] both method append in trait Buffer of type (elems: Any*)hc.content.type
[error] and method append in trait Buffer of type (elem: Any)hc.content.type
[error] match argument types (A)
[error] hc.content.append(element)
[error] ^
Reactions are currently unavailable