[swift-evolution] Disallowing unreachable code

Alex Blewitt alblue at apple.com
Wed Mar 29 08:15:52 CDT 2017


> On 29 Mar 2017, at 14:10, Jonathan Hull <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()

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


More information about the swift-evolution mailing list