Support default parameter values for inline class constructors and funs
#KT-26908 #KT-26554 Move default parameter value tests to separate directory
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// !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"
|
||||
}
|
||||
Reference in New Issue
Block a user