I am wondering why the member reference operator ( :: ) can’t be used in below code.
The sample code looks like below
val listOfElements = listOf(1, 2, 3)
Mono.just(listOfElements).flatMapMany{Flux.fromIterable(it)} //this works
Mono.just(listOfElements).flatMapMany(Flux::fromIterable) // this does not work
Sample library code in java is here
/**
*
public final <R> Flux<R> flatMapMany(Function<? super T, ? extends Publisher<? extends R>> mapper) {
return Flux.onAssembly(new MonoFlatMapMany<>(this, mapper));
}
public static <T> Flux<T> fromIterable(Iterable<? extends T> it) {
return onAssembly(new FluxIterable<>(it));
}
*/
I was following this question and then i tried to implement the same in kotlin, but unfortunately kotlin does not support member reference operator(: for this function