Make unsigned array constructor-like functions inline-only

This commit is contained in:
Ilya Gorbunov
2018-08-17 04:45:39 +03:00
parent f9479d12f9
commit a0b0994651
6 changed files with 10 additions and 25 deletions
@@ -46,11 +46,12 @@ internal constructor(private val storage: ShortArray) : Collection<UShort> {
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UShortArray(size: Int, init: (Int) -> UShort): UShortArray {
return UShortArray(ShortArray(size) { index -> init(index).toShort() })
}
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
// TODO: @kotlin.internal.InlineOnly
@kotlin.internal.InlineOnly
public inline fun ushortArrayOf(vararg elements: UShort): UShortArray = elements