scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

PriorityQueue.dequeueAll should be dequeueAll() #4834

Open scabug opened 13 years ago

scabug commented 13 years ago

According to the Scala coding standards, methods with side effects should have empty parenthesis. Hence, in collection.mutable.PriorityQueue the dequeuing method is dequeue(). However, the dequeueAll method has only a single argument list which carries the implicit CanBuildFrom. Thus you cannot call pq.dequeueAll().

So if I'm not mistaken, the signature should be

def dequeueAll[A1 >: A, That]()(implicit bf: scala.collection.generic.CanBuildFrom[_, A1, That]): That 

?

scabug commented 13 years ago

Imported From: https://issues.scala-lang.org/browse/SI-4834?orig=1 Reporter: @Sciss Affected Versions: 2.9.0

scabug commented 11 years ago

@retronym said (edited on Dec 12, 2012 7:57:29 AM UTC): Technically, we're not able to make this change without a deprecation cycle, as it might break source compatibility. (Consider code that calls an apply() method on the returned That.)

som-snytt commented 1 year ago

Missed opportunity in 2.13.

def dequeueAll[A1 >: A]: immutable.Seq[A1]