Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.kt
T
Mikhail Zarechenskiy e3b6104489 [NI] Map vararg to Array if it's resolved against type variable
While this behavior is questionable, it's consistent with OI and can
 be changed in future

 #KT-36201 Fixed
2020-01-29 11:43:14 +03:00

13 lines
255 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun <A1> fun2(f: kotlin.reflect.KFunction1<A1, Unit>, a: A1) {
f.invoke(a)
}
fun containsRegex(vararg otherPatterns: String) {}
fun main() {
fun2(::containsRegex, arrayOf("foo"))
}