[Tests] Add box tests for #KT-59904
This commit is contained in:
committed by
Space Team
parent
843ded892d
commit
f47705f123
+19
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
|
||||
fun foo(vararg ii: Int) = 1
|
||||
fun foo(vararg ss: String) = 2
|
||||
fun foo(i: Int) = 3
|
||||
|
||||
val fn1: (Int) -> Int = ::foo
|
||||
val fn2: (IntArray) -> Int = ::foo
|
||||
val fn3: (Int, Int) -> Int = ::foo // K1 reports NONE_APPLICABLE
|
||||
val fn4: (Array<String>) -> Int = ::foo
|
||||
|
||||
fun box(): String {
|
||||
if (fn1(1) != 3) return "FAIL 1"
|
||||
if (fn2(intArrayOf(1)) != 1) return "FAIL 2"
|
||||
if (fn3(1, 2) != 1) return "FAIL 3"
|
||||
if (fn4(arrayOf("")) != 2) return "FAIL 4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user