fun foo(f: () -> Unit) {} fun bar(x: Int, f: () -> Unit) {} fun baz(f: () -> Unit, other: Boolean = true) {} fun test() { // OK foo {} foo() {} foo({}) // Bad foo(1) {} foo(f = {}) {} // OK bar(1) {} bar(x = 1) {} bar(1, {}) bar(x = 1, f = {}) // Bad bar {} bar({}) // OK baz(other = false, f = {}) baz({}, false) // Bad baz {} baz() {} baz(other = false) {} }