I do not know how is your foo but sometimes the Swift compiler need a bit of help, if you define the return value, it should work.
I mean, for instance:
Consider this examples:
1. Example:
Error: Type of expression is ambiguous without more context
let values = ["text":inputTextField.text!,"toId":toId,"fromId":fromId, "timestamp":timestamp]
To solve it:
let values : [String : Any] = ["text":inputTextField.text!,"toId":toId,"fromId":fromId, "timestamp":timestamp]
or also:
let values = ["text": inputTextField.text!, "toID": toId, "fromID" : fromId, "timeStamp" : timestamp] as [String : Any]
2. Example:
Error: Ambiguous reference to member 'post(_:at:use:)'
router.post("test") { req in
print("test")
return "test"
}
To solve it:
router.post("test") { req -> String in
print("test")
return "test"
}
I hope this answer will be helpfull for you.