Use of unresolved identifier 'FutureUtils' #44
Comments
You're completely right about the documentation regarding FutureUtils. Sorry about that. In the tests, we do something similar to what you are trying to do: https://github.com/Thomvis/BrightFutures/blob/master/BrightFuturesTests/BrightFuturesTests.swift#L725. Can you try to figure out what the difference is and maybe see what is preventing your case from working? |
Ah, I found the issue. My futures were returning different types. A simple way to recreate: var future1 = Future.succeeded(1)
var future2 = Future.succeeded("string")
var allFutures = [future1, future2]
sequence(allFutures).onSuccess { result in
println("complete")
} |
Just curious: would it work if you explicitly type allFutures as |
Doesn't seem to. The following code generates a var future1 = Future.succeeded(1)
var future2 = Future.succeeded("string")
var allFutures = [future1, future2] as [Future<Any>]
sequence(allFutures).onSuccess { result in
println("complete")
} However, adding the cast to the futures themselves does work: var future1 = Future.succeeded(1) as Future<Any>
var future2 = Future.succeeded("string") as Future<Any>
var allFutures = [future1, future2]
sequence(allFutures).onSuccess { result in
println("complete")
} |
Thanks for the info. I just updated the README and pushed version 1.0.1. I'm closing this issue. |
When attempting to use FutureUtils class like above, I get the following error:
Looks like the FutureUtils functions were turned into free functions here: 17d4f21. But when I change my code to a "free function":
I get this error:
Any ideas of how to use the FutureUtils functions? Also, the documentation needs to be updated regarding the FutureUtils methods.
The text was updated successfully, but these errors were encountered: