Suppress errors about non-public primary constructor and forbidden varargs
This commit is contained in:
@@ -41,6 +41,7 @@ class UnsignedTypeGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIns
|
|||||||
out.println("import kotlin.experimental.*")
|
out.println("import kotlin.experimental.*")
|
||||||
out.println()
|
out.println()
|
||||||
|
|
||||||
|
out.println("@Suppress(\"NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS\")")
|
||||||
out.println("public inline class $className internal constructor(private val data: $storageType) : Comparable<$className> {")
|
out.println("public inline class $className internal constructor(private val data: $storageType) : Comparable<$className> {")
|
||||||
out.println()
|
out.println()
|
||||||
out.println(""" companion object {
|
out.println(""" companion object {
|
||||||
@@ -256,6 +257,7 @@ class UnsignedArrayGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIn
|
|||||||
val storageElementType = type.asSigned.capitalized
|
val storageElementType = type.asSigned.capitalized
|
||||||
val storageArrayType = storageElementType + "Array"
|
val storageArrayType = storageElementType + "Array"
|
||||||
override fun generateBody() {
|
override fun generateBody() {
|
||||||
|
out.println("@Suppress(\"NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS\")")
|
||||||
out.println("public inline class $arrayType internal constructor(private val storage: $storageArrayType) : Collection<$elementType> {")
|
out.println("public inline class $arrayType internal constructor(private val storage: $storageArrayType) : Collection<$elementType> {")
|
||||||
out.println(
|
out.println(
|
||||||
"""
|
"""
|
||||||
@@ -293,6 +295,7 @@ public /*inline*/ fun $arrayType(size: Int, init: (Int) -> $elementType): $array
|
|||||||
return $arrayType($storageArrayType(size) { index -> init(index).to$storageElementType() })
|
return $arrayType($storageArrayType(size) { index -> init(index).to$storageElementType() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("FORBIDDEN_VARARG_PARAMETER_TYPE")
|
||||||
public fun $arrayTypeOf(vararg elements: $elementType): $arrayType {
|
public fun $arrayTypeOf(vararg elements: $elementType): $arrayType {
|
||||||
return $arrayType(elements.size) { index -> elements[index] }
|
return $arrayType(elements.size) { index -> elements[index] }
|
||||||
}"""
|
}"""
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package kotlin
|
|||||||
|
|
||||||
import kotlin.experimental.*
|
import kotlin.experimental.*
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class UByte internal constructor(private val data: Byte) : Comparable<UByte> {
|
public inline class UByte internal constructor(private val data: Byte) : Comparable<UByte> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package kotlin
|
package kotlin
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class UByteArray internal constructor(private val storage: ByteArray) : Collection<UByte> {
|
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. */
|
/** 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() })
|
return UByteArray(ByteArray(size) { index -> init(index).toByte() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("FORBIDDEN_VARARG_PARAMETER_TYPE")
|
||||||
public fun ubyteArrayOf(vararg elements: UByte): UByteArray {
|
public fun ubyteArrayOf(vararg elements: UByte): UByteArray {
|
||||||
return UByteArray(elements.size) { index -> elements[index] }
|
return UByteArray(elements.size) { index -> elements[index] }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package kotlin
|
|||||||
|
|
||||||
import kotlin.experimental.*
|
import kotlin.experimental.*
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class UInt internal constructor(private val data: Int) : Comparable<UInt> {
|
public inline class UInt internal constructor(private val data: Int) : Comparable<UInt> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package kotlin
|
package kotlin
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class UIntArray internal constructor(private val storage: IntArray) : Collection<UInt> {
|
public inline class UIntArray internal constructor(private val storage: IntArray) : Collection<UInt> {
|
||||||
|
|
||||||
/** Returns the array element at the given [index]. This method can be called using the index operator. */
|
/** Returns the array element at the given [index]. This method can be called using the index operator. */
|
||||||
@@ -40,6 +41,7 @@ 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() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("FORBIDDEN_VARARG_PARAMETER_TYPE")
|
||||||
public fun uintArrayOf(vararg elements: UInt): UIntArray {
|
public fun uintArrayOf(vararg elements: UInt): UIntArray {
|
||||||
return UIntArray(elements.size) { index -> elements[index] }
|
return UIntArray(elements.size) { index -> elements[index] }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package kotlin
|
|||||||
|
|
||||||
import kotlin.experimental.*
|
import kotlin.experimental.*
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class ULong internal constructor(private val data: Long) : Comparable<ULong> {
|
public inline class ULong internal constructor(private val data: Long) : Comparable<ULong> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package kotlin
|
package kotlin
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class ULongArray internal constructor(private val storage: LongArray) : Collection<ULong> {
|
public inline class ULongArray internal constructor(private val storage: LongArray) : Collection<ULong> {
|
||||||
|
|
||||||
/** Returns the array element at the given [index]. This method can be called using the index operator. */
|
/** Returns the array element at the given [index]. This method can be called using the index operator. */
|
||||||
@@ -40,6 +41,7 @@ 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() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("FORBIDDEN_VARARG_PARAMETER_TYPE")
|
||||||
public fun ulongArrayOf(vararg elements: ULong): ULongArray {
|
public fun ulongArrayOf(vararg elements: ULong): ULongArray {
|
||||||
return ULongArray(elements.size) { index -> elements[index] }
|
return ULongArray(elements.size) { index -> elements[index] }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package kotlin
|
|||||||
|
|
||||||
import kotlin.experimental.*
|
import kotlin.experimental.*
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class UShort internal constructor(private val data: Short) : Comparable<UShort> {
|
public inline class UShort internal constructor(private val data: Short) : Comparable<UShort> {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package kotlin
|
package kotlin
|
||||||
|
|
||||||
|
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
public inline class UShortArray internal constructor(private val storage: ShortArray) : Collection<UShort> {
|
public inline class UShortArray internal constructor(private val storage: ShortArray) : Collection<UShort> {
|
||||||
|
|
||||||
/** Returns the array element at the given [index]. This method can be called using the index operator. */
|
/** Returns the array element at the given [index]. This method can be called using the index operator. */
|
||||||
@@ -40,6 +41,7 @@ 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() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("FORBIDDEN_VARARG_PARAMETER_TYPE")
|
||||||
public fun ushortArrayOf(vararg elements: UShort): UShortArray {
|
public fun ushortArrayOf(vararg elements: UShort): UShortArray {
|
||||||
return UShortArray(elements.size) { index -> elements[index] }
|
return UShortArray(elements.size) { index -> elements[index] }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user