[swift-evolution] [Pitch] Introducing the "Unwrap or Die" operator to the standard library

Erica Sadun erica at ericasadun.com
Wed Jun 28 09:47:59 CDT 2017


> On Jun 28, 2017, at 3:52 AM, Yuta Koshizawa via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hi, I think it is an orthogonal issue if we need a new operator. It is
> also possible to introduce an infix `!` for it.
> 
> I am sure that we do not need to avoid `precondition` as long as we
> use it appropriately. It is useful to realize consistent behavior with
> `Array`'s `subscript`, forced unwrapping `!`, `&+` and so on. In this
> context, `precondition` does not mean a general word "precondition"
> but the `precondition` function in the Swift standard library, which
> is removed when -Ounchecked.


How would the line run then? Would it simply act as a forced unwrapped under -Ounchecked? 

-- E



More information about the swift-evolution mailing list