Well … obviously. It’s a toy example. The point was the nested conditionals, not the method.
P > On Dec 23, 2015, at 12:12 AM, Thorsten Seitz <[email protected]> wrote: > > I find it a little bit strange that your error handling function takes an > optional in the first place. > The caller should only call an errror handler in case of an error, so you > should already have unwrapped the optional. > > -Thorsten > > Am 22.12.2015 um 18:30 schrieb Paul Cantrell via swift-evolution > <[email protected] <mailto:[email protected]>>: > >> func handleFileNotFound(error: ErrorType?) >> { >> if let error = error >> { >> if case MyError.FileNotFound(let url) = error >> { print(url) } >> } >> }
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
