Retract bitwise operators from builtins for Byte and Short and add them as extensions in kotlin.experimental package in stdlib.

#KT-16030
This commit is contained in:
Ilya Gorbunov
2017-01-28 09:22:27 +03:00
parent 9b820202b5
commit 4ac7be9fa5
4 changed files with 57 additions and 37 deletions
+2 -28
View File
@@ -185,19 +185,6 @@ public class Byte private constructor() : Number(), Comparable<Byte> {
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Long): LongRange
/** Performs a bitwise AND operation between the two values. */
@SinceKotlin("1.1")
public infix fun and(other: Byte): Byte
/** Performs a bitwise OR operation between the two values. */
@SinceKotlin("1.1")
public infix fun or(other: Byte): Byte
/** Performs a bitwise XOR operation between the two values. */
@SinceKotlin("1.1")
public infix fun xor(other: Byte): Byte
/** Inverts the bits in this value/ */
@SinceKotlin("1.1")
public fun inv(): Byte
public override fun toByte(): Byte
public override fun toChar(): Char
public override fun toShort(): Short
@@ -374,19 +361,6 @@ public class Short private constructor() : Number(), Comparable<Short> {
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Long): LongRange
/** Performs a bitwise AND operation between the two values. */
@SinceKotlin("1.1")
public infix fun and(other: Short): Short
/** Performs a bitwise OR operation between the two values. */
@SinceKotlin("1.1")
public infix fun or(other: Short): Short
/** Performs a bitwise XOR operation between the two values. */
@SinceKotlin("1.1")
public infix fun xor(other: Short): Short
/** Inverts the bits in this value/ */
@SinceKotlin("1.1")
public fun inv(): Short
public override fun toByte(): Byte
public override fun toChar(): Char
public override fun toShort(): Short
@@ -575,7 +549,7 @@ public class Int private constructor() : Number(), Comparable<Int> {
public infix fun or(other: Int): Int
/** Performs a bitwise XOR operation between the two values. */
public infix fun xor(other: Int): Int
/** Inverts the bits in this value/ */
/** Inverts the bits in this value. */
public fun inv(): Int
public override fun toByte(): Byte
@@ -766,7 +740,7 @@ public class Long private constructor() : Number(), Comparable<Long> {
public infix fun or(other: Long): Long
/** Performs a bitwise XOR operation between the two values. */
public infix fun xor(other: Long): Long
/** Inverts the bits in this value/ */
/** Inverts the bits in this value. */
public fun inv(): Long
public override fun toByte(): Byte