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

Doc for Int >> and Long >> says bit-shift left #8641

Closed
scabug opened this issue Jun 3, 2014 · 7 comments
Closed

Doc for Int >> and Long >> says bit-shift left #8641

scabug opened this issue Jun 3, 2014 · 7 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Jun 3, 2014

The Scala API doc for Int method >> and Long method >> appear to be copy-pasted from << without modifying:
"Returns this value bit-shifted left by the specified number of bits, filling in the right bits with the same value as the left-most bit of this. The effect of this is to retain the sign of the value."

The example is correct, though.

@scabug
Copy link
Author

scabug commented Jun 3, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8641?orig=1
Reporter: Matthew Harrison (harryhuk)
Affected Versions: 2.10.3, 2.11.0

@scabug
Copy link
Author

scabug commented Jun 3, 2014

Matthew Harrison (harryhuk) said:
(I even got confused creating the issue! :D )

@scabug
Copy link
Author

scabug commented Jun 3, 2014

Matthew Harrison (harryhuk) said:
Char >> and Byte >> doc comments are also wrong

@scabug
Copy link
Author

scabug commented Jun 3, 2014

Matthew Harrison (harryhuk) said:
having read the guidelines in a little more depth, (well, ok, having read them..) I understand that for changes I could do myself, (and this is pretty small one) a pull request is preferred. I've created a fork, and made a proposed change in src/compiler/scala/tools/cmd/gen/AnyVals.scala . Will submit the pull request later if that's agreeable.

@scabug
Copy link
Author

scabug commented Jun 12, 2014

Matthew Harrison (harryhuk) said:
Adriaan Moors has merged my pull request ( scala/scala#3810 ) with the fix into the 2.12.x branch

@scabug
Copy link
Author

scabug commented Jan 2, 2016

Linas Medžiūnas (linasm) said (edited on Jan 2, 2016 9:33:56 PM UTC):
For whatever reason the changes in src/compiler/scala/tools/cmd/gen/AnyVals.scala have still not propagated to Int.scala, Long.scala, etc. and the documentation of >> operator is still incorrect:
http://www.scala-lang.org/api/current/#scala.Int
abstract def >>(x: Int): Int
"Returns this value bit-shifted left by the specified number of bits, filling in the right bits with the same value as the left-most bit of this."

@scabug
Copy link
Author

scabug commented Jan 3, 2016

Linas Medžiūnas (linasm) said:
OK, looks like CodeGen has not been executed to propagate the fix from src/compiler/scala/tools/cmd/gen/AnyVals.scala to the actual integer types.
Executed CodeGen, PR submitted: scala/scala#4890

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

No branches or pull requests

2 participants