why doesn't this work? ``` val defaultHandler: Con...
# announcements
a
why doesn't this work?
Copy code
val defaultHandler: Consumer<in Throwable>? = RxJavaPlugins.getErrorHandler()
checkNotNull(defaultHandler)
defaultHandler.accept(Throwable()) // only safe or non-null asserted calls are allowed on nullable receiver of type...
what's the point in this then:
Copy code
public inline fun <T:Any> checkNotNull(value: T?, lazyMessage: () -> Any): T {
    contract {
        returns() implies (value != null)
    }
c
For now you can do this:
Copy code
val defaultHandler: Consumer<in Throwable> = checkNotNull(RxJavaPlugins.getErrorHandler())
a
Thanks 😉 that's what I did as well
g
contracts disabled for now on 1.2 Available by default without flag in 1.3