title: Cast Realm List to Array without expliciting its type
body: <p>When using <code>Mirror</code> to iterate through an <code>Object</code> properties, how do I cast a <code>List&lt;Object&gt;</code> to Swift primitive array type <code>[Object]</code>?</p>
  
  <p>My code is structured as follow</p>
  
  <pre><code>    let mirror = Mirror(reflecting: myObjecy)
  
      for (_, attr) in mirror.children.enumerated() {
          let object = attr.value
  
          if let encodableAttribute = attr.value as? [Protocol] {
              ...
          }
      }
  </code></pre>
  
  <p>Here <code>attr.value</code> has type <code>Any</code>. I would like that when this value is from kind <code>List&lt;Object&gt;</code>, to cast it as it is in the <code>if</code> statement, but without casting it to <code>List</code> before, because I want it to be generic to work with normal arrays as well.</p>