mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 08:31:29 +00:00
Relates to KT-8834, we continue reducing differences between old and new inference. Note that as for `SamConversionPerArgument`, this feature is enabled in the compiler and not in the IDE to avoid breaking code for those users that already enabled new inference in the compiler
18 lines
372 B
Kotlin
Vendored
18 lines
372 B
Kotlin
Vendored
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
|
|
// IGNORE_BACKEND: JS
|
|
|
|
fun foo(s: String = "kotlin", vararg t: String): Boolean {
|
|
if (s != "kotlin") throw AssertionError(s)
|
|
if (t.size != 0) throw AssertionError(t.size.toString())
|
|
return true
|
|
}
|
|
|
|
fun bar(f: () -> Unit) {
|
|
f()
|
|
}
|
|
|
|
fun box(): String {
|
|
bar(::foo)
|
|
return "OK"
|
|
}
|