Suppress errors about non-public primary constructor and forbidden varargs

This commit is contained in:
Ilya Gorbunov
2018-05-09 04:45:13 +03:00
parent 0eee258fce
commit 793d34b913
9 changed files with 15 additions and 0 deletions
@@ -7,6 +7,7 @@
package kotlin
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
public inline class UByteArray internal constructor(private val storage: ByteArray) : Collection<UByte> {
/** Returns the array element at the given [index]. This method can be called using the index operator. */
@@ -40,6 +41,7 @@ public /*inline*/ fun UByteArray(size: Int, init: (Int) -> UByte): UByteArray {
return UByteArray(ByteArray(size) { index -> init(index).toByte() })
}
@Suppress("FORBIDDEN_VARARG_PARAMETER_TYPE")
public fun ubyteArrayOf(vararg elements: UByte): UByteArray {
return UByteArray(elements.size) { index -> elements[index] }
}