Permalink
Browse files

[nomaster] duplicate tailImpl as a private method

Reworks d526f8b.
This is necessary to maintain binary compatibility with 2.10.0.

    matchName="scala.collection.mutable.MutableList.tailImpl"
    problemName=MissingMethodProblem
  • Loading branch information...
adriaanm committed Feb 8, 2013
1 parent 8b4af71 commit 5d487f105f1f2890506c3e99e352a02f206fad83
@@ -1,10 +1,10 @@
filter {
problems=[
# rework d526f8bd74 to duplicate tailImpl as a private method
- {
- matchName="scala.collection.mutable.MutableList.tailImpl"
- problemName=MissingMethodProblem
- },
+ # {
+ # matchName="scala.collection.mutable.MutableList.tailImpl"
+ # problemName=MissingMethodProblem
+ # },
{
# can only be called from Stream::distinct, which cannot itself be inlined, so distinct is the only feasible call-site
matchName="scala.collection.immutable.Stream.scala$collection$immutable$Stream$$loop$6"
@@ -61,7 +61,8 @@ extends AbstractSeq[A]
tl
}
- protected final def tailImpl(tl: MutableList[A]) {
+ // this method must be private for binary compatibility
+ private final def tailImpl(tl: MutableList[A]) {
require(nonEmpty, "tail of empty list")
tl.first0 = first0.tail
tl.len = len - 1
@@ -167,6 +167,13 @@ extends MutableList[A]
*/
def front: A = head
+ // this method (duplicated from MutableList) must be private for binary compatibility
+ private final def tailImpl(tl: Queue[A]) {
+ require(nonEmpty, "tail of empty list")
+ tl.first0 = first0.tail
+ tl.len = len - 1
+ tl.last0 = if (tl.len == 0) tl.first0 else last0
+ }
// TODO - Don't override this just for new to create appropriate type....
override def tail: Queue[A] = {

0 comments on commit 5d487f1

Please sign in to comment.