Skip to content

Commit 9e3cfba

Browse files
authored
Merge pull request scala/scala#6680 from lrytz/pr6370
Deprecate bit shifting by Long value
2 parents 8910985 + 57a31c7 commit 9e3cfba

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

library/src/scala/Byte.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ final abstract class Byte private extends AnyVal {
5555
* filling in the new right bits with zeroes.
5656
* @example {{{ 6 << 3 == 48 // in binary: 0110 << 3 == 0110000 }}}
5757
*/
58+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
5859
def <<(x: Long): Int
5960
/**
6061
* Returns this value bit-shifted right by the specified number of bits,
@@ -77,6 +78,7 @@ final abstract class Byte private extends AnyVal {
7778
* // 00011111 11111111 11111111 11111101
7879
* }}}
7980
*/
81+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
8082
def >>>(x: Long): Int
8183
/**
8284
* Returns this value bit-shifted right by the specified number of bits,
@@ -99,6 +101,7 @@ final abstract class Byte private extends AnyVal {
99101
* // 11111111 11111111 11111111 11111101
100102
* }}}
101103
*/
104+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
102105
def >>(x: Long): Int
103106

104107
/** Returns `true` if this value is equal to x, `false` otherwise. */

library/src/scala/Char.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ final abstract class Char private extends AnyVal {
5555
* filling in the new right bits with zeroes.
5656
* @example {{{ 6 << 3 == 48 // in binary: 0110 << 3 == 0110000 }}}
5757
*/
58+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
5859
def <<(x: Long): Int
5960
/**
6061
* Returns this value bit-shifted right by the specified number of bits,
@@ -77,6 +78,7 @@ final abstract class Char private extends AnyVal {
7778
* // 00011111 11111111 11111111 11111101
7879
* }}}
7980
*/
81+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
8082
def >>>(x: Long): Int
8183
/**
8284
* Returns this value bit-shifted right by the specified number of bits,
@@ -99,6 +101,7 @@ final abstract class Char private extends AnyVal {
99101
* // 11111111 11111111 11111111 11111101
100102
* }}}
101103
*/
104+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
102105
def >>(x: Long): Int
103106

104107
/** Returns `true` if this value is equal to x, `false` otherwise. */

library/src/scala/Function0.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
** |/ **
77
\* */
88
// GENERATED CODE: DO NOT EDIT.
9-
// genprod generated these sources at: Mon Jun 08 18:05:40 CEST 2015
9+
// genprod generated these sources at: Wed May 30 22:17:36 CEST 2018
1010

1111
package scala
1212

library/src/scala/Int.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ final abstract class Int private extends AnyVal {
5555
* filling in the new right bits with zeroes.
5656
* @example {{{ 6 << 3 == 48 // in binary: 0110 << 3 == 0110000 }}}
5757
*/
58+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
5859
def <<(x: Long): Int
5960
/**
6061
* Returns this value bit-shifted right by the specified number of bits,
@@ -77,6 +78,7 @@ final abstract class Int private extends AnyVal {
7778
* // 00011111 11111111 11111111 11111101
7879
* }}}
7980
*/
81+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
8082
def >>>(x: Long): Int
8183
/**
8284
* Returns this value bit-shifted right by the specified number of bits,
@@ -99,6 +101,7 @@ final abstract class Int private extends AnyVal {
99101
* // 11111111 11111111 11111111 11111101
100102
* }}}
101103
*/
104+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
102105
def >>(x: Long): Int
103106

104107
/** Returns `true` if this value is equal to x, `false` otherwise. */

library/src/scala/Short.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ final abstract class Short private extends AnyVal {
5555
* filling in the new right bits with zeroes.
5656
* @example {{{ 6 << 3 == 48 // in binary: 0110 << 3 == 0110000 }}}
5757
*/
58+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
5859
def <<(x: Long): Int
5960
/**
6061
* Returns this value bit-shifted right by the specified number of bits,
@@ -77,6 +78,7 @@ final abstract class Short private extends AnyVal {
7778
* // 00011111 11111111 11111111 11111101
7879
* }}}
7980
*/
81+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
8082
def >>>(x: Long): Int
8183
/**
8284
* Returns this value bit-shifted right by the specified number of bits,
@@ -99,6 +101,7 @@ final abstract class Short private extends AnyVal {
99101
* // 11111111 11111111 11111111 11111101
100102
* }}}
101103
*/
104+
@deprecated("shifting a value by a `Long` argument is deprecated (except when the value is a `Long`).\nCall `toInt` on the argument to maintain the current behavior and avoid the deprecation warning.", "2.12.7")
102105
def >>(x: Long): Int
103106

104107
/** Returns `true` if this value is equal to x, `false` otherwise. */

0 commit comments

Comments
 (0)