sunbreak
06/27/2019, 4:28 AMfun foo(block: (Int) -> Unit) { ... }
in Kotlin would be func foo(block: (KotlinInt) -> KotlinUnit)
in Swfit, and foo(Function1<Integer, Unit> block)
in Java.
Both require KotlinUnit.Init() (or Unit.INSTANCE)
After upgraded to 1.3.40, it can be func foo(block: (KotlinInt) -> Void)
in Swift, without the KotlinUnit.Init().
Would it possible to omit the Unit.INSTANCE in Java?gildor
06/27/2019, 4:49 AMit possible to omit the Unit.INSTANCE in JavaNo, it’s not possible, because Such lambda represented by interface
Function1<in P1, out R>
on JVM, so you cannot declar R as Void.