title: How to nest low level errors and higher level errors?
body: <p>I have a custom error type, for low level HTTP problems:</p>
  
  <pre><code>enum APIClientError: ErrorType {
      case NetworkError
      ...
  }
  </code></pre>
  
  <p>In a higher level layer I have another error type:</p>
  
  <pre><code>enum SignInError: ErrorType {
      case InvalidUser
      ...
  }
  </code></pre>
  
  <p>The problem I have is that those <code>APIClientError</code> instances need to bubble up to the higher level layer and in my function I need to return maybe an <code>APIClientError</code>, maybe an <code>SignInError</code>.</p>
  
  <p>How can I declare a function like that? I tried</p>
  
  <pre><code>typealias LoginResult = Result&lt;SuccessType, ErrorType&gt;
  </code></pre>
  
  <p>But I does not work ('Using ErrorType' as a concrete type conforming to protocol 'ErrorType' is not supported').</p>
  
  <p>How can I nest error types from different layers in Swift?</p>