Function compatibility from Fantom


#1

After Fantom I miss function compatibility. Look section "Type Compatibility" at fantom.org/doc/docLang/Functions

fun process(fn:()->Unit){...}

val can:()->Boolean = {true}

process(can) // this is not compiled: Type mismatch: inferred type is () -> kotlin.Boolean but () -> kotlin.Unit was expected

//expect: compiled as process{can()}

// and

val addOne:(Int)->Int = {it+1}

fun mult(num:Int,fn:(Int,Int)->Int) = {…}

mult(2,addOne) // this dont compile

//expect: compiled as mult(2){a,b -> addOne(a)}


What u think about function compatibility for Kotlin?