> On Jun 28, 2017, at 7:47 AM, Erica Sadun via swift-evolution > <[email protected]> wrote: > > >> On Jun 28, 2017, at 3:52 AM, Yuta Koshizawa via swift-evolution >> <[email protected]> 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?
From the docs: "In -Ounchecked builds, the optimizer may assume that this function is never called. Failure to satisfy that assumption is a serious programming error.” Aka, v. bad things happen if the precondition does not hold. > > -- E > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
