Support passing inline class values with spread operator

This commit is contained in:
Mikhail Zarechenskiy
2018-02-12 06:21:39 +03:00
parent 3919dc94e1
commit e017e9cb5f
8 changed files with 71 additions and 2 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +InlineClasses
inline class UInt(val u: Int)
fun <T> takeVarargs(vararg e: T) {}
fun test(u1: UInt, u2: UInt, us: Array<UInt>) {
takeVarargs(*us) // copy + checkcast
takeVarargs(u1, u2, *us) // 2 box + ...
}
// 2 INVOKESTATIC UInt\$Erased.box
// 0 INVOKEVIRTUAL UInt.unbox
// 2 CHECKCAST \[LUInt
// 0 CHECKCAST \[Ljava/lang/Integer
// 0 intValue
// 0 valueOf