summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-02-08 15:09:20 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-02-09 18:10:16 -0800
commit5d487f105f1f2890506c3e99e352a02f206fad83 (patch)
treea904bb7ed38d0b35881c63837e55240a57278216
parent8b4af71d27ebd56f318e31ffc69225f3fdd6232d (diff)
downloadscala-5d487f105f1f2890506c3e99e352a02f206fad83.tar.gz
scala-5d487f105f1f2890506c3e99e352a02f206fad83.tar.bz2
scala-5d487f105f1f2890506c3e99e352a02f206fad83.zip
[nomaster] duplicate tailImpl as a private method
Reworks d526f8bd74. This is necessary to maintain binary compatibility with 2.10.0. matchName="scala.collection.mutable.MutableList.tailImpl" problemName=MissingMethodProblem
-rw-r--r--bincompat-forward.whitelist.conf8
-rw-r--r--src/library/scala/collection/mutable/MutableList.scala3
-rw-r--r--src/library/scala/collection/mutable/Queue.scala7
3 files changed, 13 insertions, 5 deletions
diff --git a/bincompat-forward.whitelist.conf b/bincompat-forward.whitelist.conf
index 9673976c60..cb8191fbcc 100644
--- a/bincompat-forward.whitelist.conf
+++ b/bincompat-forward.whitelist.conf
@@ -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"
diff --git a/src/library/scala/collection/mutable/MutableList.scala b/src/library/scala/collection/mutable/MutableList.scala
index fd92d2e555..bc6272bfdb 100644
--- a/src/library/scala/collection/mutable/MutableList.scala
+++ b/src/library/scala/collection/mutable/MutableList.scala
@@ -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
diff --git a/src/library/scala/collection/mutable/Queue.scala b/src/library/scala/collection/mutable/Queue.scala
index b947fa3cca..8ef5f6aeb7 100644
--- a/src/library/scala/collection/mutable/Queue.scala
+++ b/src/library/scala/collection/mutable/Queue.scala
@@ -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] = {