From 7fcf3d35dc7c174a7f2e431b05d4d2906d6eac74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vedran=20Pri=C5=A1=C4=87an?= Date: Wed, 26 Aug 2020 22:57:13 +0200 Subject: [PATCH] Upgrade to Kotlin 1.4; deprecate methods made obsolete with new type inference algorithm --- README.md | 5 +- build.gradle.kts | 2 +- .../io/reactivex/rxjava3/kotlin/Flowables.kt | 64 ++++++++++++++++++- .../io/reactivex/rxjava3/kotlin/Maybes.kt | 28 ++++++++ .../reactivex/rxjava3/kotlin/Observables.kt | 64 ++++++++++++++++++- .../io/reactivex/rxjava3/kotlin/Singles.kt | 28 ++++++++ 6 files changed, 187 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0a14c8c..8c7d8e9 100755 --- a/README.md +++ b/README.md @@ -229,7 +229,10 @@ Learn more about building this project with JitPack [here](https://jitpack.io/#R -## SAM Helpers +## SAM Helpers (made obsolete since Kotlin 1.4) + +_These methods have been made obsolete with new type inference algorithm in Kotlin 1.4. +They will be removed in some future RxKotlin version._ To help cope with the [SAM ambiguity issue](https://youtrack.jetbrains.com/issue/KT-14984) when using RxJava with Kotlin, there are a number of helper factories and extension functions to workaround the affected operators. diff --git a/build.gradle.kts b/build.gradle.kts index f5397b1..43a8a84 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ buildscript { plugins { id("java-library") - kotlin("jvm") version "1.3.40" + kotlin("jvm") version "1.4.0" id("org.jetbrains.dokka") version "0.9.18" id("maven-publish") id("com.jfrog.bintray") version "1.8.4" diff --git a/src/main/kotlin/io/reactivex/rxjava3/kotlin/Flowables.kt b/src/main/kotlin/io/reactivex/rxjava3/kotlin/Flowables.kt index ac87c48..f8725be 100644 --- a/src/main/kotlin/io/reactivex/rxjava3/kotlin/Flowables.kt +++ b/src/main/kotlin/io/reactivex/rxjava3/kotlin/Flowables.kt @@ -15,6 +15,9 @@ import org.reactivestreams.Publisher object Flowables { + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -38,6 +41,9 @@ object Flowables { BiFunction> { t1, t2 -> t1 to t2 }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -63,6 +69,9 @@ object Flowables { Function3> { t1, t2, t3 -> Triple(t1, t2, t3) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, source4, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -76,6 +85,9 @@ object Flowables { Function4 { t1: T1, t2: T2, t3: T3, t4: T4 -> combineFunction(t1, t2, t3, t4) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, source4, source5, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -90,6 +102,9 @@ object Flowables { Function5 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5 -> combineFunction(t1, t2, t3, t4, t5) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, source4, source5, source6, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -104,6 +119,9 @@ object Flowables { ): Flowable = Flowable.combineLatest(source1, source2, source3, source4, source5, source6, Function6 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6 -> combineFunction(t1, t2, t3, t4, t5, t6) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, source4, source5, source6, source7, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -120,6 +138,9 @@ object Flowables { Function7 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7 -> combineFunction(t1, t2, t3, t4, t5, t6, t7) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, source4, source5, source6, source7, source8, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -136,6 +157,9 @@ object Flowables { ): Flowable = Flowable.combineLatest(source1, source2, source3, source4, source5, source6, source7, source8, Function8 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8 -> combineFunction(t1, t2, t3, t4, t5, t6, t7, t8) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.combineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -162,7 +186,9 @@ object Flowables { crossinline source: (FlowableEmitter) -> Unit ): Flowable = Flowable.create({ source(it) }, mode) - + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -183,6 +209,9 @@ object Flowables { Flowable.zip(source1, source2, BiFunction> { t1, t2 -> t1 to t2 }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -207,6 +236,9 @@ object Flowables { ): Flowable> = Flowable.zip(source1, source2, source3, Function3> { t1, t2, t3 -> Triple(t1, t2, t3) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, source4, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -219,6 +251,9 @@ object Flowables { ): Flowable = Flowable.zip(source1, source2, source3, source4, Function4 { t1: T1, t2: T2, t3: T3, t4: T4 -> combineFunction(t1, t2, t3, t4) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, source4, source5, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -230,6 +265,9 @@ object Flowables { Function5 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5 -> combineFunction(t1, t2, t3, t4, t5) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, source4, source5, source6, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -240,6 +278,9 @@ object Flowables { ): Flowable = Flowable.zip(source1, source2, source3, source4, source5, source6, Function6 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6 -> combineFunction(t1, t2, t3, t4, t5, t6) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, source4, source5, source6, source7, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -252,6 +293,9 @@ object Flowables { Function7 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7 -> combineFunction(t1, t2, t3, t4, t5, t6, t7) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, source4, source5, source6, source7, source8, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -264,6 +308,9 @@ object Flowables { ): Flowable = Flowable.zip(source1, source2, source3, source4, source5, source6, source7, source8, Function8 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8 -> combineFunction(t1, t2, t3, t4, t5, t6, t7, t8) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Flowable.zip(source1, source2, source3, source4, source5, source6, source7, source8, source9, combineFunction)", "io.reactivex.Flowable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -286,6 +333,9 @@ object Flowables { /** * An alias to [Flowable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(other, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @@ -304,6 +354,9 @@ fun Flowable.withLatestFrom(other: Publisher): Flowable /** * An alias to [Flowable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(o1, o2, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @@ -324,6 +377,9 @@ fun Flowable.withLatestFrom( /** * An alias to [Flowable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(o1, o2, o3, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) @@ -337,6 +393,9 @@ inline fun Flowable.withLate /** * An alias to [Flowable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(o1, o2, o3, o4, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @@ -351,6 +410,9 @@ inline fun Flowable zip( @@ -27,6 +31,9 @@ object Maybes { BiFunction { t, u -> Pair(t, u) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -46,6 +53,9 @@ object Maybes { ): Maybe> = Maybe.zip(s1, s2, s3, Function3 { t1, t2, t3 -> Triple(t1, t2, t3) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, s4, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -56,6 +66,9 @@ object Maybes { ): Maybe = Maybe.zip(s1, s2, s3, s4, Function4 { t1, t2, t3, t4 -> zipper.invoke(t1, t2, t3, t4) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, s4, s5, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -67,6 +80,9 @@ object Maybes { ): Maybe = Maybe.zip(s1, s2, s3, s4, s5, Function5 { t1, t2, t3, t4, t5 -> zipper.invoke(t1, t2, t3, t4, t5) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, s4, s5, s6, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -78,6 +94,9 @@ object Maybes { ): Maybe = Maybe.zip(s1, s2, s3, s4, s5, s6, Function6 { t1, t2, t3, t4, t5, t6 -> zipper.invoke(t1, t2, t3, t4, t5, t6) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, s4, s5, s6, s7, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -90,6 +109,9 @@ object Maybes { ): Maybe = Maybe.zip(s1, s2, s3, s4, s5, s6, s7, Function7 { t1, t2, t3, t4, t5, t6, t7 -> zipper.invoke(t1, t2, t3, t4, t5, t6, t7) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, s4, s5, s6, s7, s8, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -102,6 +124,9 @@ object Maybes { ): Maybe = Maybe.zip(s1, s2, s3, s4, s5, s6, s7, s8, Function8 { t1, t2, t3, t4, t5, t6, t7, t8 -> zipper.invoke(t1, t2, t3, t4, t5, t6, t7, t8) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Maybe.zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, zipper)", "io.reactivex.Maybe"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -119,6 +144,9 @@ object Maybes { /** * An alias to [Maybe.zipWith], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("zipWith(other, zipper)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Maybe.zipWith( diff --git a/src/main/kotlin/io/reactivex/rxjava3/kotlin/Observables.kt b/src/main/kotlin/io/reactivex/rxjava3/kotlin/Observables.kt index 71c9e6d..31246d3 100644 --- a/src/main/kotlin/io/reactivex/rxjava3/kotlin/Observables.kt +++ b/src/main/kotlin/io/reactivex/rxjava3/kotlin/Observables.kt @@ -13,6 +13,9 @@ import io.reactivex.rxjava3.functions.* */ object Observables { + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -31,6 +34,9 @@ object Observables { Observable.combineLatest(source1, source2, BiFunction> { t1, t2 -> t1 to t2 }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -53,6 +59,9 @@ object Observables { ): Observable> = Observable.combineLatest(source1, source2, source3, Function3> { t1, t2, t3 -> Triple(t1, t2, t3) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, source4, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -62,6 +71,9 @@ object Observables { Function4 { t1: T1, t2: T2, t3: T3, t4: T4 -> combineFunction(t1, t2, t3, t4) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, source4, source5, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -72,6 +84,9 @@ object Observables { Function5 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5 -> combineFunction(t1, t2, t3, t4, t5) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, source4, source5, source6, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -81,6 +96,9 @@ object Observables { ): Observable = Observable.combineLatest(source1, source2, source3, source4, source5, source6, Function6 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6 -> combineFunction(t1, t2, t3, t4, t5, t6) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, source4, source5, source6, source7, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -92,6 +110,9 @@ object Observables { Function7 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7 -> combineFunction(t1, t2, t3, t4, t5, t6, t7) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, source4, source5, source6, source7, source8, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -103,6 +124,9 @@ object Observables { ): Observable = Observable.combineLatest(source1, source2, source3, source4, source5, source6, source7, source8, Function8 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8 -> combineFunction(t1, t2, t3, t4, t5, t6, t7, t8) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.combineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun combineLatest( @@ -115,6 +139,9 @@ object Observables { Function9 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9 -> combineFunction(t1, t2, t3, t4, t5, t6, t7, t8, t9) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -134,6 +161,9 @@ object Observables { Observable.zip(source1, source2, BiFunction> { t1, t2 -> t1 to t2 }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -156,6 +186,9 @@ object Observables { ): Observable> = Observable.zip(source1, source2, source3, Function3> { t1, t2, t3 -> Triple(t1, t2, t3) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, source4, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -167,6 +200,9 @@ object Observables { ): Observable = Observable.zip(source1, source2, source3, source4, Function4 { t1: T1, t2: T2, t3: T3, t4: T4 -> combineFunction(t1, t2, t3, t4) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, source4, source5, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -177,6 +213,9 @@ object Observables { Function5 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5 -> combineFunction(t1, t2, t3, t4, t5) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, source4, source5, source6, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -186,6 +225,9 @@ object Observables { ): Observable = Observable.zip(source1, source2, source3, source4, source5, source6, Function6 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6 -> combineFunction(t1, t2, t3, t4, t5, t6) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, source4, source5, source6, source7, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -196,7 +238,9 @@ object Observables { ): Observable = Observable.zip(source1, source2, source3, source4, source5, source6, source7, Function7 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7 -> combineFunction(t1, t2, t3, t4, t5, t6, t7) }) - + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, source4, source5, source6, source7, source8, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -208,6 +252,9 @@ object Observables { ): Observable = Observable.zip(source1, source2, source3, source4, source5, source6, source7, source8, Function8 { t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8 -> combineFunction(t1, t2, t3, t4, t5, t6, t7, t8) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Observable.zip(source1, source2, source3, source4, source5, source6, source7, source8, source9, combineFunction)", "io.reactivex.Observable"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -225,6 +272,9 @@ object Observables { /** * An alias to [Observable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(other, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Observable.withLatestFrom( @@ -243,6 +293,9 @@ fun Observable.withLatestFrom(other: ObservableSource): /** * An alias to [Observable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(o1, o2, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Observable.withLatestFrom( @@ -261,6 +314,9 @@ fun Observable.withLatestFrom( /** * An alias to [Observable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(o1, o2, o3, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Observable.withLatestFrom( @@ -273,6 +329,9 @@ inline fun Observable.withLa /** * An alias to [Observable.withLatestFrom], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("withLatestFrom(o1, o2, o3, o4, combiner)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Observable.withLatestFrom( @@ -287,6 +346,9 @@ inline fun Observable /** * An alias to [Observable.zipWith], but allowing for cleaner lambda syntax. */ +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("zipWith(other, zipper)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Observable.zipWith( diff --git a/src/main/kotlin/io/reactivex/rxjava3/kotlin/Singles.kt b/src/main/kotlin/io/reactivex/rxjava3/kotlin/Singles.kt index 686e9e9..65636a5 100644 --- a/src/main/kotlin/io/reactivex/rxjava3/kotlin/Singles.kt +++ b/src/main/kotlin/io/reactivex/rxjava3/kotlin/Singles.kt @@ -8,6 +8,10 @@ import io.reactivex.rxjava3.functions.* object Singles { + + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun zip( @@ -24,6 +28,9 @@ object Singles { ): Single> = Single.zip(s1, s2, BiFunction { t, u -> Pair(t, u) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -41,6 +48,9 @@ object Singles { s3: SingleSource ): Single> = Single.zip(s1, s2, s3, Function3 { t1, t2, t3 -> Triple(t1, t2, t3) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, s4, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -51,6 +61,9 @@ object Singles { ): Single = Single.zip(s1, s2, s3, s4, Function4 { t1, t2, t3, t4 -> zipper.invoke(t1, t2, t3, t4) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, s4, s5, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -62,6 +75,9 @@ object Singles { ): Single = Single.zip(s1, s2, s3, s4, s5, Function5 { t1, t2, t3, t4, t5 -> zipper.invoke(t1, t2, t3, t4, t5) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, s4, s5, s6, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -73,6 +89,9 @@ object Singles { ): Single = Single.zip(s1, s2, s3, s4, s5, s6, Function6 { t1, t2, t3, t4, t5, t6 -> zipper.invoke(t1, t2, t3, t4, t5, t6) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, s4, s5, s6, s7, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -85,6 +104,9 @@ object Singles { ): Single = Single.zip(s1, s2, s3, s4, s5, s6, s7, Function7 { t1, t2, t3, t4, t5, t6, t7 -> zipper.invoke(t1, t2, t3, t4, t5, t6, t7) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, s4, s5, s6, s7, s8, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -97,6 +119,9 @@ object Singles { ): Single = Single.zip(s1, s2, s3, s4, s5, s6, s7, s8, Function8 { t1, t2, t3, t4, t5, t6, t7, t8 -> zipper.invoke(t1, t2, t3, t4, t5, t6, t7, t8) }) + @Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("Single.zip(s1, s2, s3, s4, s5, s6, s7, s8, s9, zipper)", "io.reactivex.Single"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun @@ -111,6 +136,9 @@ object Singles { Function9 { t1, t2, t3, t4, t5, t6, t7, t8, t9 -> zipper.invoke(t1, t2, t3, t4, t5, t6, t7, t8, t9) }) } +@Deprecated("New type inference algorithm in Kotlin 1.4 makes this method obsolete. Method will be removed in future RxKotlin release.", + replaceWith = ReplaceWith("zipWith(other, zipper)"), + level = DeprecationLevel.WARNING) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) inline fun Single.zipWith(