title: How to merge multiple arrays in Swift?
body: <p>I have several classes look like this:</p>
  
  <pre>
  
  class A {}
  class A1 : A {}
  class A2 : A {}
  
  class A3 : A {}
  class A4 : A {}
  
  class main {
      var a1 : A1
      var a2 : A2
      var a3s : [A3]
      var a4s : [A4]
  
      func getAll() -> [A] {
          return ([a1, a2] + a3s + a4s)
      }
  }
  
  </pre>
  
  <p>If you take a look on function getAll(), you will see I try to return an Array of all object with type is the base class A. However, I always get the error: </p>
  
  <blockquote>
    <p>"Binary operator '+(<em>:</em>:)' cannot be applied to operands of type '[Any]' and '[a3s]'"</p>
  </blockquote>
  
  <p>Do you know what the proper way is in this case?</p>