Created
September 17, 2011 18:54
-
-
Save soc/1224225 to your computer and use it in GitHub Desktop.
Scala migration-update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ./scala | |
scala> collection.mutable.Buffer(1,2,3,4) - 3 | |
res0: scala.collection.mutable.Buffer[Int] = ArrayBuffer(1, 2, 4) | |
scala> List(1, 2, 3, 4).scanRight(0)(_ + _) | |
res1: List[Int] = List(10, 9, 7, 4, 0) | |
% ./scala -Xmigration | |
scala> collection.mutable.Buffer(1,2,3,4) - 3 | |
res0: scala.collection.mutable.Buffer[Int] = ArrayBuffer(1, 2, 4) | |
scala> List(1, 2, 3, 4).scanRight(0)(_ + _) | |
<console>:8: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9: | |
The behavior of `scanRight` has changed. The previous behavior can be reproduced with scanRight.reverse. | |
List(1, 2, 3, 4).scanRight(0)(_ + _) | |
^ | |
res1: List[Int] = List(10, 9, 7, 4, 0) | |
% ./scala -Xmigration:2.8 | |
scala> collection.mutable.Buffer(1,2,3,4) - 3 | |
<console>:8: warning: method - in trait BufferLike has changed semantics in version 2.8: | |
`-` creates a new buffer. Use `-=` to remove an element from this buffer and return that buffer itself. | |
collection.mutable.Buffer(1,2,3,4) - 3 | |
^ | |
res0: scala.collection.mutable.Buffer[Int] = ArrayBuffer(1, 2, 4) | |
scala> List(1, 2, 3, 4).scanRight(0)(_ + _) | |
<console>:8: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9: | |
The behavior of `scanRight` has changed. The previous behavior can be reproduced with scanRight.reverse. | |
List(1, 2, 3, 4).scanRight(0)(_ + _) | |
^ | |
res1: List[Int] = List(10, 9, 7, 4, 0) | |
% ./scala -Xmigration:2.9 | |
scala> collection.mutable.Buffer(1,2,3,4) - 3 | |
res0: scala.collection.mutable.Buffer[Int] = ArrayBuffer(1, 2, 4) | |
scala> List(1, 2, 3, 4).scanRight(0)(_ + _) | |
<console>:8: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9: | |
The behavior of `scanRight` has changed. The previous behavior can be reproduced with scanRight.reverse. | |
List(1, 2, 3, 4).scanRight(0)(_ + _) | |
^ | |
res1: List[Int] = List(10, 9, 7, 4, 0) | |
% ./scala -Xmigration:2.10 | |
scala> collection.mutable.Buffer(1,2,3,4) - 3 | |
res0: scala.collection.mutable.Buffer[Int] = ArrayBuffer(1, 2, 4) | |
scala> List(1, 2, 3, 4).scanRight(0)(_ + _) | |
res1: List[Int] = List(10, 9, 7, 4, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment