I don’t get why that type checks:
1. rescue always throws inside sync, therefore
2. _syncHelper inside sync always throws, therefore
3. sync always throws, therefore
4. Shouldn’t sync be declared throws not rethrows?
-- Howard.
On 1 Jan 2018, at 1:10 pm, Charles Srstka via swift-users
> On Dec 31, 2017, at 1:35 AM, Nevin Brackett-Rozinsky via swift-users
> wrote:
>
> So, I know this doesn’t actually address your issue, but I think it is
> important to clarify that “rethrows” does not guarantee anything about the
> *type* of error thrown by a function. What “rethrows” implie
How about this?
func withPredicateErrors(
_ predicate: @escaping (Element) throws -> Bool,
do body: ((Element) -> Bool) -> Return
) rethrows
-> Return
{
var caught: Error?
var element: Element?
let value = body { elem in
element = elem
do {
On Sat, Dec 30, 2017 at 11:35 PM, Nevin Brackett-Rozinsky via swift-users <
swift-users@swift.org> wrote:
> So, I know this doesn’t actually address your issue, but I think it is
> important to clarify that “rethrows” does not guarantee anything about the
> *type* of error thrown by a function. Wh
So, I know this doesn’t actually address your issue, but I think it is
important to clarify that “rethrows” does not guarantee anything about the
*type* of error thrown by a function. What “rethrows” implies is that the
function *will not throw* unless at least one of its arguments throws.
In part
I need to do something like this:
func withPredicateErrors(_ predicate: (Element) throws
-> Bool, do body: ((Element) -> Bool) -> Return) rethrows -> Return {
var caught: Error?
let value = body { elem in
do {
return try predicate(elem)