https://kotlinlang.org logo
#android
Title
# android
z

zone

08/27/2018, 2:10 PM
On line 11 I am getting
type inference failed not enough information fun<T: Any!> error( exception: Throwable!): Single<T!>!
d

Denis A

08/27/2018, 2:19 PM
pls, replace first string and database[id] fo val elt = database[id] ?: return Single.error(Throwable(“Not found”))
database[id]!! is very bad case
z

zone

08/27/2018, 2:23 PM
thank you. Will keep that in mind. The main problem is it's not compiling in flatmap returning
return@flatMap Single.error(Throwable(""))
giving error
d

Dominaezzz

08/27/2018, 2:26 PM
Is it fine with
Single.error<User>
and/or
Single.just(database[0]!!)
?
💯 2
z

zone

08/27/2018, 2:35 PM
now working with
Single.error<User>
d

Denis A

08/27/2018, 3:02 PM
I don’t understand, why do i need use flatmap in this example
z

zone

08/27/2018, 3:03 PM
Hi see the new question