kirillrakhman
02/09/2017, 12:47 PMval function = BiFunction { it: String, it2: String -> "$it $it2" }
2) synthetic overloads for functions taking SAM types that accept function types. Example: File.list(FilenameFilter) gets a synthetic overload File.list((File, String) -> Boolean)
The limitation with case 2) is that only one overload is generated for each signature where every SAM type is replaced with the respective function type. Now, the function Observable.combineLatest has the signature
Observable#combineLatest(ObservableSource<? extends T1>, ObservableSource<? extends T2>, BiFunction<? super T1,? super T2,? extends R>)
As it turns out, ObservableSource is a SAM type itself (Observable implements it) and the synthetic overload that is generated is
Observable#combineLatest((Observer<in T1>) -> Unit, (Observer<in T2>) -> Unit, (T1, T2) -> R)
Unfortunately, this is not the signature you're looking for. What you need is a signature where the first two parameters are not SAM converted, but the third is. This is currently not supported