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:
Dmitry Petrov
2018-10-02 18:04:45 +03:00
parent 8ce1d09f8a
commit f68ce4b35b
26 changed files with 435 additions and 135 deletions
@@ -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"
}