I have a question here, it seems that some of the operators don’t really sink in my brain.
So, in the stories
function, when getting the new story ids from the hackernews API, we use the mergedStories
function in the .flatMap
part of the chain.
It works great but if I try to replace the “return self.mergedStories(ids: storyIDs)
with the body in the mergedStories
function it does not allow it and throws a compile error at me.
Why is that? Basically the two are equivalent, but apparently there’s something not right.
I can’t tell for sure without seeing the full code but sometimes the compiler will fail to type-check closure code if the closure doesn’t include all the arguments and return type - that’s got me few times in the past too
No, it’s not compiler check thing, I also ran into things that closures sometimes require arguments and return types and don’t satisfy with the ‘$number’ short-code.
There has to be something about how combine operators work.
Thanks for replying though!
@hastoro11 Do you still have issues with this?