Changing my playground code to Swift 3, Xcode suggested changing
enum Error: ErrorType {
case NotFound
}
to
enum Error: Error {
case NotFound
}
but now I get the title error and I don't know how to get the enum to conform to that protocol.
The problem is that you've named your error type
Error– which conflicts with the standard libraryErrorprotocol (therefore Swift thinks you've got a circular reference).You could refer to the Swift
Errorprotocol asSwift.Errorin order to disambiguate:But this will mean that any future references to
Errorin your module will refer to yourErrortype, not the SwiftErrorprotocol (you'll have to disambiguate again).Therefore the easiest solution by far would be simply renaming your error type to something more descriptive.