> On Jun 28, 2017, at 6:32 PM, Xiaodi Wu <[email protected]> wrote:
>
> the reason why a function would return nil _are intended to be obvious, per
> the design rationale given in Swift project documents_.
The reason .last returns nil is obvious. But it doesn’t tell you anything about
why the array itself should be non-empty at this point in the code.
> I do not believe that "array must not be empty" or "array guaranteed
> non-empty" is such an example, and I cannot myself imagine another scenario
> where it would make such a difference.
As the screener of a non-zero number of radars resulting from unwrapped nils, I
would certainly appreciate more use of guard let x = x else {
fatalError(“explanation”) } and hope that !! would encourage it.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution