Hi! I converted my Java code to Kotlin and got uncompiled code. The example below:
class SomeClass (var callbackMessage: String){
fun someMethod(callback: SomeCallback) {
//do something
callback.invoke(callbackMessage)
}
}
interface SomeCallback {
fun invoke(someString: String)
}
fun main(args: Array<String>) {
val someInstance = SomeClass("abc")
//uncompiled. reason: cannot infer type
//someInstance.someMethod({someString -> println(someString)})
//someInstance.someMethod({someString -> println(someString)} as SomeCallback)
//compiled
someInstance.someMethod({someString: String -> println(someString)} as SomeCallback)
}