[swift-evolution] Disallowing unreachable code

John McCall rjmccall at apple.com
Wed Mar 29 10:11:38 CDT 2017


> On Mar 29, 2017, at 9:15 AM, Alex Blewitt <alblue at apple.com> wrote:
>> On 29 Mar 2017, at 14:10, Jonathan Hull <jhull at gbis.com <mailto:jhull at gbis.com>> wrote:
>> 
>> I think the idea is that it also adds a warning so you can find it later.
> 
> @available(*, deprecated, message: "Don't forget to implement this")
> func unimplemented<T>(_ file:String = #file,_ line:Int = #line) -> T {
>   fatalError("Not implemented \(file):\(line)")
> }
> 
> let f: String = unimplemented()

I was suggesting that it would be a useful addition to the language, not that it
necessarily needed new compiler support.

Does someone want to write a proposal for it?

John.

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


More information about the swift-evolution mailing list