8000 SI-10164 BitSet.tail zigs where it zagged by som-snytt · Pull Request #5697 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

SI-10164 BitSet.tail zigs where it zagged #5697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

som-snytt
Copy link
Contributor

A cut/paste issue, an increment was held over from head,
which scans forward, to tail, which scans backward.

Fix is due to reporter.

A cut/paste issue, an increment was held over from head,
which scans forward, to tail, which scans backward.
@scala-jenkins scala-jenkins added this to the 2.12.2 milestone Feb 14, 2017
@som-snytt
Copy link
Contributor Author

Maybe @Ichoran can explain the asymmetry. I guess the "Laws of Ichoran" test suite would handle permutations of mutability.

amarki ~/projects/scala
$ scal
8000
a
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.

scala> import collection._
import collection._

scala> immutable.BitSet(0, 128).last
res0: Int = 128

scala> mutable.BitSet(0, 128).last
java.util.NoSuchElementException: Empty BitSet
  at scala.collection.BitSetLike.last(BitSetLike.scala:225)
  at scala.collection.BitSetLike.last$(BitSetLike.scala:218)
  at scala.collection.mutable.BitSet.last(BitSet.scala:40)
  ... 29 elided

scala> :quit

amarki ~/projects/scala
$ skala
Welcome to Scala 2.12.2-20170213-205850-9ea5010 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.

scala> import collection._
import collection._

scala> immutable.BitSet(0, 128).last
res0: Int = 128

scala> mutable.BitSet(0, 128).last
res1: Int = 128

@adriaanm adriaanm requested review from szeiger and Ichoran February 16, 2017 20:38
Copy link
Contributor
@Ichoran Ichoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting cleanup looks good, and the bug fix looks correct.

@som-snytt
Copy link
Contributor Author

I would have settled for correct! Thanks, @Ichoran !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0