Regenerate inline class tests as 1 arg value classes

This commit is contained in:
Evgeniy.Zhelenskiy
2021-12-14 19:43:05 +03:00
committed by Space
parent 5ac4722be4
commit ec2e96f3e4
398 changed files with 9654 additions and 3771 deletions
+4 -4
View File
@@ -1,7 +1,8 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE")
@kotlin.jvm.JvmInline
OPTIONAL_JVM_INLINE_ANNOTATION
value class Rgba(val value: Int) {
inline val r: Int get() = (value shr 0) and 0xFF
inline val g: Int get() = (value shr 8) and 0xFF
@@ -20,8 +21,7 @@ fun Rgba.withG(g: Int) = Rgba(r, g, b, a)
fun Rgba.withB(b: Int) = Rgba(r, g, b, a)
fun Rgba.withA(a: Int) = Rgba(r, g, b, a)
@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE")
@kotlin.jvm.JvmInline
OPTIONAL_JVM_INLINE_ANNOTATION
value class RgbaArray(val array: IntArray) {
constructor(size: Int) : this(IntArray(size))
operator fun get(index: Int): Rgba = Rgba(array[index])