Swift 3’s “Never”
SE-0102 removes the rarely-used
@noreturnfunction type and replaced it with a dead-end return type[…][…]
Neverallows a function or method tothrow: e.g.() throws -> Never. Throwing allows a secondary path for error remediation, even in functions that were not expected to return.As a first class type,
Neverworks with generics in a way that the@noreturnattribute could not.
Guard conditions require you to exit scope.
Nevermean you cannotreturnfrom your function. So, instead, add a simpledo-scope layer[…]
Fortunately, I don’t think this sort of contortion is commonly needed.