我try 编写以下代码:
val s: Function<String, String> = { s -> s + s }
它编译时出现以下错误:
Type mismatch: inferred type is (???) -> [Error type: Return type for function cannot be resolved] but Function<String, String> was expected
Cannot infer a type for this parameter. Please specify it explicitly.
将Kotlin
个lambda分配给Java
个函数的正确方式是什么?