package foo
fun interface Callback {
fun doit(): Unit
}
fun foo(cb: () -> Unit) {} // (1)
fun foo(cb: Callback) {} // (2)
fun test() {
foo {} // resolved to (1)
}
Exhibit 2:
package foo
fun ambiguous(sfn: suspend () -> Unit) = sfn // (1)
fun ambiguous(fn: () -> Unit) = fn // (2)
fun test(fn: () -> Unit) = ambiguous(fn) // resolved to (2)
// Note: this will need fixing after the compatibility mode disabling
Some additional info available at Quip (Disabling new inference compatibility mode).
Exhibit 1:
Exhibit 2:
Some additional info available at Quip (Disabling new inference compatibility mode).