Skip to content

Commit

Permalink
Make cast and ofType operate on wildcard types rather than Any (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansman authored and thomasnield committed Jul 17, 2018
1 parent 8db8e88 commit d8d6a89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/io/reactivex/rxkotlin/maybe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import io.reactivex.annotations.SchedulerSupport

@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
inline fun <reified R : Any> Maybe<Any>.cast(): Maybe<R> = cast(R::class.java)
inline fun <reified R : Any> Maybe<*>.cast(): Maybe<R> = cast(R::class.java)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
inline fun <reified R : Any> Maybe<Any>.ofType(): Maybe<R> = ofType(R::class.java)
inline fun <reified R : Any> Maybe<*>.ofType(): Maybe<R> = ofType(R::class.java)



Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/io/reactivex/rxkotlin/single.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import io.reactivex.annotations.BackpressureSupport
import io.reactivex.annotations.CheckReturnValue
import io.reactivex.annotations.SchedulerSupport

inline fun <reified R : Any> Single<Any>.cast(): Single<R> = cast(R::class.java)
inline fun <reified R : Any> Single<*>.cast(): Single<R> = cast(R::class.java)


// EXTENSION FUNCTION OPERATORS
Expand Down

0 comments on commit d8d6a89

Please sign in to comment.