Make unsigned array constructor-like functions inline-only
This commit is contained in:
@@ -328,13 +328,14 @@ class UnsignedArrayGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIn
|
|||||||
out.println("""
|
out.println("""
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun $arrayType(size: Int, init: (Int) -> $elementType): $arrayType {
|
public inline fun $arrayType(size: Int, init: (Int) -> $elementType): $arrayType {
|
||||||
return $arrayType($storageArrayType(size) { index -> init(index).to$storageElementType() })
|
return $arrayType($storageArrayType(size) { index -> init(index).to$storageElementType() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
// TODO: @kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun $arrayTypeOf(vararg elements: $elementType): $arrayType = elements"""
|
public inline fun $arrayTypeOf(vararg elements: $elementType): $arrayType = elements"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: ByteArray) : Collection<UByte> {
|
|||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun UByteArray(size: Int, init: (Int) -> UByte): UByteArray {
|
public inline fun UByteArray(size: Int, init: (Int) -> UByte): UByteArray {
|
||||||
return UByteArray(ByteArray(size) { index -> init(index).toByte() })
|
return UByteArray(ByteArray(size) { index -> init(index).toByte() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
// TODO: @kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun ubyteArrayOf(vararg elements: UByte): UByteArray = elements
|
public inline fun ubyteArrayOf(vararg elements: UByte): UByteArray = elements
|
||||||
|
|||||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: IntArray) : Collection<UInt> {
|
|||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun UIntArray(size: Int, init: (Int) -> UInt): UIntArray {
|
public inline fun UIntArray(size: Int, init: (Int) -> UInt): UIntArray {
|
||||||
return UIntArray(IntArray(size) { index -> init(index).toInt() })
|
return UIntArray(IntArray(size) { index -> init(index).toInt() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
// TODO: @kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun uintArrayOf(vararg elements: UInt): UIntArray = elements
|
public inline fun uintArrayOf(vararg elements: UInt): UIntArray = elements
|
||||||
|
|||||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: LongArray) : Collection<ULong> {
|
|||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun ULongArray(size: Int, init: (Int) -> ULong): ULongArray {
|
public inline fun ULongArray(size: Int, init: (Int) -> ULong): ULongArray {
|
||||||
return ULongArray(LongArray(size) { index -> init(index).toLong() })
|
return ULongArray(LongArray(size) { index -> init(index).toLong() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
// TODO: @kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun ulongArrayOf(vararg elements: ULong): ULongArray = elements
|
public inline fun ulongArrayOf(vararg elements: ULong): ULongArray = elements
|
||||||
|
|||||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: ShortArray) : Collection<UShort> {
|
|||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun UShortArray(size: Int, init: (Int) -> UShort): UShortArray {
|
public inline fun UShortArray(size: Int, init: (Int) -> UShort): UShortArray {
|
||||||
return UShortArray(ShortArray(size) { index -> init(index).toShort() })
|
return UShortArray(ShortArray(size) { index -> init(index).toShort() })
|
||||||
}
|
}
|
||||||
|
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@ExperimentalUnsignedTypes
|
@ExperimentalUnsignedTypes
|
||||||
// TODO: @kotlin.internal.InlineOnly
|
@kotlin.internal.InlineOnly
|
||||||
public inline fun ushortArrayOf(vararg elements: UShort): UShortArray = elements
|
public inline fun ushortArrayOf(vararg elements: UShort): UShortArray = elements
|
||||||
|
|||||||
-20
@@ -314,11 +314,6 @@ public final class kotlin/UByteArray$Erased {
|
|||||||
public static fun toString ([B)Ljava/lang/String;
|
public static fun toString ([B)Ljava/lang/String;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class kotlin/UByteArrayKt {
|
|
||||||
public static final fun UByteArray (ILkotlin/jvm/functions/Function1;)[B
|
|
||||||
public static final fun ubyteArrayOf ([B)[B
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class kotlin/UByteKt {
|
public final class kotlin/UByteKt {
|
||||||
public static final fun toUByte (B)B
|
public static final fun toUByte (B)B
|
||||||
public static final fun toUByte (I)B
|
public static final fun toUByte (I)B
|
||||||
@@ -434,11 +429,6 @@ public final class kotlin/UIntArray$Erased {
|
|||||||
public static fun toString ([I)Ljava/lang/String;
|
public static fun toString ([I)Ljava/lang/String;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class kotlin/UIntArrayKt {
|
|
||||||
public static final fun UIntArray (ILkotlin/jvm/functions/Function1;)[I
|
|
||||||
public static final fun uintArrayOf ([I)[I
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class kotlin/UIntKt {
|
public final class kotlin/UIntKt {
|
||||||
public static final fun toUInt (B)I
|
public static final fun toUInt (B)I
|
||||||
public static final fun toUInt (I)I
|
public static final fun toUInt (I)I
|
||||||
@@ -554,11 +544,6 @@ public final class kotlin/ULongArray$Erased {
|
|||||||
public static fun toString ([J)Ljava/lang/String;
|
public static fun toString ([J)Ljava/lang/String;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class kotlin/ULongArrayKt {
|
|
||||||
public static final fun ULongArray (ILkotlin/jvm/functions/Function1;)[J
|
|
||||||
public static final fun ulongArrayOf ([J)[J
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class kotlin/ULongKt {
|
public final class kotlin/ULongKt {
|
||||||
public static final fun toULong (B)J
|
public static final fun toULong (B)J
|
||||||
public static final fun toULong (I)J
|
public static final fun toULong (I)J
|
||||||
@@ -672,11 +657,6 @@ public final class kotlin/UShortArray$Erased {
|
|||||||
public static fun toString ([S)Ljava/lang/String;
|
public static fun toString ([S)Ljava/lang/String;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class kotlin/UShortArrayKt {
|
|
||||||
public static final fun UShortArray (ILkotlin/jvm/functions/Function1;)[S
|
|
||||||
public static final fun ushortArrayOf ([S)[S
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class kotlin/UShortKt {
|
public final class kotlin/UShortKt {
|
||||||
public static final fun toUShort (B)S
|
public static final fun toUShort (B)S
|
||||||
public static final fun toUShort (I)S
|
public static final fun toUShort (I)S
|
||||||
|
|||||||
Reference in New Issue
Block a user