Skip to content

Commit 5d487f1

Browse files
committed
[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
1 parent 8b4af71 commit 5d487f1

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

bincompat-forward.whitelist.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
filter {
22
problems=[
33
# rework d526f8bd74 to duplicate tailImpl as a private method
4-
{
5-
matchName="scala.collection.mutable.MutableList.tailImpl"
6-
problemName=MissingMethodProblem
7-
},
4+
# {
5+
# matchName="scala.collection.mutable.MutableList.tailImpl"
6+
# problemName=MissingMethodProblem
7+
# },
88
{
99
# can only be called from Stream::distinct, which cannot itself be inlined, so distinct is the only feasible call-site
1010
matchName="scala.collection.immutable.Stream.scala$collection$immutable$Stream$$loop$6"

src/library/scala/collection/mutable/MutableList.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ extends AbstractSeq[A]
6161
tl
6262
}
6363

64-
protected final def tailImpl(tl: MutableList[A]) {
64+
// this method must be private for binary compatibility
65+
private final def tailImpl(tl: MutableList[A]) {
6566
require(nonEmpty, "tail of empty list")
6667
tl.first0 = first0.tail
6768
tl.len = len - 1

src/library/scala/collection/mutable/Queue.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ extends MutableList[A]
167167
*/
168168
def front: A = head
169169

170+
// this method (duplicated from MutableList) must be private for binary compatibility
171+
private final def tailImpl(tl: Queue[A]) {
172+
require(nonEmpty, "tail of empty list")
173+
tl.first0 = first0.tail
174+
tl.len = len - 1
175+
tl.last0 = if (tl.len == 0) tl.first0 else last0
176+
}
170177

171178
// TODO - Don't override this just for new to create appropriate type....
172179
override def tail: Queue[A] = {

0 commit comments

Comments
 (0)