Files
kotlin-fork/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt
T
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00

43 lines
1019 B
Kotlin
Vendored

// IGNORE_BACKEND_K2: JVM_IR
// TARGET_BACKEND: JVM
// !LANGUAGE: -ProhibitVarargAsArrayAfterSamArgument
// WITH_JDK
// FILE: arrayAsVarargAfterSamArgument.kt
fun test(fn: () -> Unit, r: Runnable, arr: Array<String>) {
Test.foo1({}, arr)
Test.foo1({}, *arr)
Test.foo1(fn, arr)
Test.foo1(fn, *arr)
Test.foo1(r, "")
Test.foo1(fn, arr)
Test.foo1(fn, *arr)
Test.foo1(r, *arr)
val i1 = Test({}, arr)
val i2 = Test({}, *arr)
val i3 = Test({}, {}, arr)
val i4 = Test(r, {}, "")
val i5 = Test({}, {}, *arr)
val i6 = Test(r, {}, *arr)
i1.foo2({}, {}, arr)
i1.foo2(r, {}, "")
i1.foo2({}, {}, *arr)
i1.foo2(r, {}, *arr)
}
// FILE: Test.java
public class Test {
public static String foo1(Runnable r, String... strs) {
return null;
}
public String foo2(Runnable r1, Runnable r2, String... strs) {
return null;
}
public Test(Runnable r, String... strs) {}
public Test(Runnable r1, Runnable r2, String... strs) {}
}