[FIR] add support for varargs in delegated constructor calls
Also add support for spread operators as named arguments.
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
3652ac9354
commit
858731cac8
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
open class SomeClass(val some: Double, val other: Int, vararg val args: String) {
|
||||
fun result() = args[1]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun foo1(
|
||||
vararg p1: Int,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// See also KT-6299
|
||||
public open class Outer private constructor(val s: String, vararg i: Int) {
|
||||
class Inner: Outer("xyz")
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
fun join(x: Array<out String>): String {
|
||||
var result = ""
|
||||
for (i in x) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
fun booleanVararg(vararg xs: Boolean) {
|
||||
if (xs.size != 1 && xs[0] != true) throw AssertionError()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
fun box(): String {
|
||||
if (test1() != "") return "fail 1"
|
||||
if (test1(1) != "1") return "fail 2"
|
||||
|
||||
Reference in New Issue
Block a user