title: Why does the value of an Error localizedDescription depends on the inferred type?
body: <p>Consider the simple code below:</p>
  
  <pre><code>func showError(error: Error) {
      debugPrint("A", error)
      debugPrint("B", error.localizedDescription)
      if let myError = error as? BarError {
          debugPrint("C", myError.localizedDescription)
      }
  }
  </code></pre>
  
  <p>The following code outputs: </p>
  
  <pre><code>"A" external error: La connexion Internet semble interrompue.
  "B" "L’opération n’a pas pu s’achever. (Foo.BarError erreur 0.)"
  "C" "An error happened. My description. (external error: La connexion Internet semble interrompue.)"
  </code></pre>
  
  <p>How come <code>.localizedDescription</code> does not return the same message depending on what type the compiler thinks the object is?</p>
  
  <p>Here is the code for <code>BarError</code>:</p>
  
  <pre><code>public enum BarError: Error, CustomStringConvertible {
      case a
      case b
      case externalError(Error)
  
      var localizedDescription: String {
          return "An error happened. My description. (\(self))"
      }
  
      public var description: String {
          switch self {
          case .a:
              return "A"
          case .b:
              return "B"
          case .externalError(let error):
              return "external error: \(error.localizedDescription)"
      }
  }
  </code></pre>