// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION fun interface KRunnable { fun invoke() } object Test1 { fun foo(x: Any) {} fun foo(f: () -> Unit) {} object Scope { fun foo(r: KRunnable) {} fun test(f: () -> Unit) { foo(f) } } } object Test2 { fun foo(f: () -> String) {} object Scope { fun foo(r: KRunnable) {} fun test(f: () -> Unit) { foo(f) } } } object Test3 { fun foo(i: Int, r: KRunnable): Int = 0 fun foo(n: Number, f: () -> Unit): String = "" fun test(f: () -> Unit) { val result = foo(1, f) result } } object Test4 { fun foo(i: Int, r: KRunnable): Int = 0 fun foo(n: Number, f: () -> Unit): String = "" fun bar() {} fun test() { val result = foo(1, ::bar) result } } object Test5 { fun foo(x: Any) {} fun foo(f: () -> Unit) {} object Scope { fun foo(r: KRunnable) {} fun test() { foo { } } } }