Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt26554.kt
T
Dmitry Petrov f68ce4b35b Support default parameter values for inline class constructors and funs
#KT-26908
 #KT-26554

Move default parameter value tests to separate directory
2018-10-15 12:21:14 +03:00

20 lines
519 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JS, JS_IR, JVM_IR
// WITH_RUNTIME
data class RGBA(val rgba: Int)
inline class RgbaArray(val array: IntArray) {
val size: Int get() = array.size
fun fill(value: RGBA, start: Int = 0, end: Int = this.size): Unit = array.fill(value.rgba, start, end)
}
fun box(): String {
val rgbas = RgbaArray(IntArray(10))
rgbas.fill(RGBA(123456))
for (i in rgbas.array.indices) {
if (rgbas.array[i] != 123456) throw AssertionError()
}
return "OK"
}