[swift-evolution] [Pitch] "unavailable" members shouldn't need an impl

Erica Sadun erica at ericasadun.com
Fri Jun 10 16:26:42 CDT 2016


> On Jun 10, 2016, at 3:22 PM, Austin Zheng via swift-evolution <swift-evolution at swift.org> wrote:
> 
> So, instead of:
> 
> @available(*, unavailable, renamed:"someNewAPI()")
> public func someOldAPI() -> Int { fatalError() }
> 
> You can just have:
> 
> @available(*, unavailable, renamed:"someNewAPI()")
> public func someOldAPI() -> Int
> 
> The intent is, in my opinion, clearer for the latter and it feels less kludgy.

You ask, we answer. I'd much prefer spelling out { fatalError("unavailable API") }. 
It makes the code clearer to read, to maintain, it produces debug and runtime errors. etc. I think 
this is an example where concision is overrated.

-- E


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160610/aac0759d/attachment.html>


More information about the swift-evolution mailing list