Hello, in the code below I'm expecting `.getOrHand...
# arrow
r
Hello, in the code below I'm expecting
.getOrHandle
to return
List<ContractorTas>
, however compiler thinks there is
List<Any>
. What am I doing wrong?
s
I think you want
getOrElse
here, no?
r
What's the difference between those two? I thought
handle
is for handling errors,
Left
case
s
Strange, can you share the whole snippet?
r
Sure, mate
message has been deleted
s
Sorry, I was mistaken after checking the signature.
getOrHandle
is indeed what you want
r
parZip reifies <B>?
s
No
What signature does
getContractorsTasks
have?
suspend fun t(): Either<ApiError, List<ContractorTask>>
?
r
exactly
s
That’s super strange.
Can you capture the values and explicitly type them and see what the error is?
r
what do you mean by "capturing the valuse"?
y
Maybe also try placing your cursor on getOrHandle and pressing Alt+Enter -> "Specify type parameters explicitly" in Intellij to see what type params the compiler is inferring
☝️ 2
s
Copy code
parZip(
 {
   val tasks: Either<ApiError, List<ContractorTasks>> = taskInteractor.getContractorTasks()
  val x: ? = tasks.getOrHandle { }
   x
 }, ...
r
got it
1 minute
👍 1
@simon.vergauwen my bad, Simon. I forgot, I mapped
ContractorTask
->
ContractorTaskViewObject
, I'm sorry, for taking your time
👍 1
s
No worries! Glad it’s working fine for you 🙂
r
It's all @Jorge Castillo fault: I'm reading his book about Compose, during doing my job 😄
😂 1
j
oh noes 🙈