'LoginError' is ambiguous for type lookup in this context

79 views Asked by At

I'm working with Combine and composable architecture and not sure which is the root cause of the error I'm seeing.

In my login module I'm getting the following error

'LoginError' is ambiguous for type lookup in this context

public enum LoginAction: Equatable, BindableAction {
    case login(fbToken: String, fbEmail: String)
    case receivedLogin(Result<ResponseCode, LoginError>)
}

In my interface the login method is called from

public var getLoginToken: (LoginRequest) -> Effect<ResponseCode, LoginError>

In my Api module the LoginError is defined as

public enum LoginError: Equatable, LocalizedError {
    case invalidUserPassword
    case invalidServerResponse
    case urlSessionError(URLError)

    public var errorDescription: String {
        switch self {
        case .invalidUserPassword:
            return ApiClientStrings.invalidUserPassword
        case .invalidServerResponse:
            return ApiClientStrings.httpError
        case let .urlSessionError(error):
            return "\(ApiClientStrings.urlSessionError) \(error.localizedDescription)"
        }
    }
}

What's weird is another class in my Login module I'm calling LoginError and I don't get that error.

0

There are 0 answers