Make unsigned types experimental (with warning if not opted-in)
This commit is contained in:
@@ -11,6 +11,7 @@ import kotlin.experimental.*
|
||||
|
||||
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
public inline class UByte internal constructor(private val data: Byte) : Comparable<UByte> {
|
||||
|
||||
companion object {
|
||||
@@ -130,10 +131,14 @@ public inline class UByte internal constructor(private val data: Byte) : Compara
|
||||
}
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun Byte.toUByte(): UByte = UByte(this)
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun Short.toUByte(): UByte = UByte(this.toByte())
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun Int.toUByte(): UByte = UByte(this.toByte())
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
public fun Long.toUByte(): UByte = UByte(this.toByte())
|
||||
|
||||
Reference in New Issue
Block a user