I like this idea, but I like idea of treating `Never` as a bottom type more.
This would allow other `Never`-returning functions like `preconditionFailure`
to be used as well.
let x = y ?? preconditonFailure("reason")
This also avoids the issue of `!!` needing `file` and `line` arguments.
Cheers,
Jaden Geller
> On Jun 27, 2017, at 10:16 AM, Erica Sadun via swift-evolution
> <[email protected]> wrote:
>
> Using an operator to provide feedback on the context of a failed unwrap has
> become a commonly implemented approach in the Swift developer Community. What
> are your thoughts about adopting this widely-used operator into the standard
> library?
>
> guard !lastItem.isEmpty else { return }
> let lastItem = array.last !! "Array must be non-empty"
>
> Details here: https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b
> <https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b>
>
> Thank you for your thoughtful feedback, -- 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