[swift-users] Can't get Error pattern matching to work cross framework and command line tool

Joakim Hassila joj at mac.com
Tue May 31 10:50:32 CDT 2016

Hi Ian,

Nope, it is the only definition - I also actually have tried to fully qualify it as Z.Transaction.Error.NotFound without any difference both at the throw and catch sides.

I do believe the compiler would have warned if the enum was ambigious also...



> On 31 maj 2016, at 17:23, Ian Terrell <ian.terrell at gmail.com> wrote:
> Is this a naming collision? Do multiple modules defined a Transaction.Error.NotFound?
> For instance, in your passing case, is the Transaction.Error.NotFound that is caught a Z.Transaction.Error.NotFound, or one in your local app module (i.e. CLI.Transaction.Error.NotFound).
> If your CLI module has that defined, then that is what you are looking for in the catch statement. And since a Z.Transaction is not a CLI.Transaction it fails to catch it appropriately.
> Just a thought.
> Ian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160531/6314f43a/attachment.html>

More information about the swift-users mailing list