print deprecation warning for bitshift Int by a Long
See original GitHub issueThe current situation is pretty bad:
2.11/Dotty:
scala> 1 << 33L
res0: Long = 8589934592
scala> val x = 1
x: Int = 1
scala> x << 33L
res1: Int = 0
2.12 (since https://github.com/scala/scala/pull/4238):
scala> 1 << 33L
res0: Int = 2
scala> val x = 1
x: Int = 1
scala> x << 33L
res1: Int = 2
See also the discussion at https://gitter.im/scala/contributors?at=598b4b3eee5c9a4c5fa61568 where @ichoran proposed getting rid of Int#<<(x: Long)
since it can be so easily misused.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why doesn't left bit shift << shift beyond 31 for long int datatype?
There is another issue with your intended code: 1L << 63 causes undefined behaviour if long is 64-bit or less. This is because...
Read more >Left shift (<<) - JavaScript - MDN Web Docs
This operator shifts the first operand the specified number of bits to the left. Excess bits shifted off to the left are discarded....
Read more >Intrinsics for Integer Bit Shift Operations - Intel
Intrinsics for Integer Bit Shift Operations ; a. first source vector element ; src. source element to use based on writemask result ;...
Read more >Release Notes — Airflow Documentation
2 we “deprecated” passing an execution date to XCom.get methods, but there was no other option for operator links as they were only...
Read more >Lua 5.3 Reference Manual
int lua_error (lua_State *L);. Generates a Lua error, using the value at the top of the stack as the error object. This function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One should write one’s contracts especially carefully when dealing with those who are shifty: spell things out.
so it seems to be that the issue here is not printing the deprecation warning for
<<(that: Long)