ValV
07/11/2019, 8:37 AMCompleter
that has only one method (function) public abstract int complete(arg1, arg2, arg3)
, so when a variable completer: Completer?
is assigned, it's done via Java lambda
completer = (arg1, arg2, arg3) -> { ... }
Instead of creating (at least) anonymous object of type Completer
and override
-ing the complete
method. Is it possible to do something like that in Kotlin, or I have to do
object: Completer {
override fun complete(arg1, arg2, arg3) { ... }
}
Why I can't do it with lambda -- because the compiler complains that completer
must be of type Completer?
, not (???, ???, ???) -> Unit
Pavlo Liapota
07/11/2019, 8:40 AMval c = Completer { arg1, arg2, arg3 -> ... }
ValV
07/11/2019, 9:05 AM