Skip to content
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

2.12 regression in BitSet/bitmask #10162

Closed
scabug opened this issue Jan 24, 2017 · 4 comments
Closed

2.12 regression in BitSet/bitmask #10162

scabug opened this issue Jan 24, 2017 · 4 comments

Comments

@scabug
Copy link

scabug commented Jan 24, 2017

in 2.10/2.11 the following returns the input array, but in 2.12 the returned array is truncated to one element (the zero is dropped).

import scala.collection.immutable._ ; println(BitSet.fromBitMaskNoCopy(Array(-9223372036854775808L, 0L)).toBitMask.toList)

In ENSIME we were using the BitSet mask as a mechanism to encode/decode BigInts, but that now breaks.

It's no big deal, we weren't even using this functionality. I understand that this is potentially internal implementation detail.

@scabug
Copy link
Author

scabug commented Jan 24, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10162?orig=1
Reporter: Samuel Halliday (fommil)
Affected Versions: 2.12.1

@scabug
Copy link
Author

scabug commented Jan 24, 2017

Samuel Halliday (fommil) said:
scala/scala#5127 looks like it caused this

@scabug
Copy link
Author

scabug commented Jan 24, 2017

Samuel Halliday (fommil) said:
for the gory details of how we were doing it: https://github.com/ensime/ensime-server/blob/63cf102bb4b50964a6e15591ba4d7da3e9fdf816/s-express/src/main/scala/org/ensime/sexp/formats/BigDecimalConvertor.scala#L49-L83

FYI this was very convenient because it aligned exactly with how emacs lisp stores larges numbers https://github.com/ensime/ensime-server/blob/63cf102bb4b50964a6e15591ba4d7da3e9fdf816/s-express/src/main/scala/org/ensime/sexp/formats/CollectionFormats.scala#L100-L155

but we didn't need it in the protocol... it was just for completeness.

@scabug
Copy link
Author

scabug commented Jan 24, 2017

Samuel Halliday (fommil) said:
in fact, it may be the case that ensime doesn't need BigInt => BitSet => BigInt roundtripping. Only BitSet => BigInt => BitSet matters. I may just rewrite our tests and consider this a corner case.

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

No branches or pull requests

1 participant