title: Using 'Protocol' as a concrete type conforming to protocol 'Protocol' is not supported
body: <p>I have the following swift code:</p>
  
  <pre><code>protocol Animal {
  var name: String { get }
  }
  
  struct Bird: Animal {
      var name: String
      var canEat: [Animal]
  }
  
  struct Mammal: Animal {
      var name: String
  }
  
  extension Array where Element: Animal {
      func mammalsEatenByBirds() -&gt; [Mammal] {
          var eatenMammals: [Mammal] = []
          self.forEach { animal in
              if let bird = animal as? Bird {
                  bird.canEat.forEach { eatenAnimal in
                      if let eatenMammal = eatenAnimal as? Mammal {
                          eatenMammals.append(eatenMammal)
                      } else if let eatenBird = eatenAnimal as? Bird {
                          let innerMammals = eatenBird.canEat.mammalsEatenByBirds()
                          eatenMammals.append(contentsOf: innerMammals)
                      }
                  }
              }
          }
          return eatenMammals
      }
  }
  </code></pre>
  
  <p>The compiler does not let me compile complaining:
  <strong>Using 'Animal' as a concrete type conforming to protocol 'Animal' is not supported</strong> at the point where I recursively call the function <strong>mammalsEatenByBirds()</strong></p>
  
  <p>I have seen some other answers but could not relate my problem to any of those.</p>