This is most common inside of a type that has its own Error
type. For example:
class MyClass {
enum Error {
...
}
...
}
This can also happen if you've declared an Error
type globally. Prior to Swift 3, this was no problem, but in Swift 3 it collides with the new stdlib Error
type. To fix it, you either need to change your Error
type's name, or (more commonly), just be explicit about which module you're pulling from. So this line of code would become:
... withError error: Swift.Error?) {