title: "Use of undeclared type " error when iterating over an array of Type
body: <p>Given an array containing instances of several SubClasses (all having the same SuperClass), I want to check if all the elements of another array of required subClass Types are represented by the instances. </p>
  
  <p>I came up with what I think is a valid solution, but I'm plagued by the error: Use of undeclared type 'requiredType' in the closure for requiredTypes.allSatisfy { ... }</p>
  
  <pre><code>class MyClass { }
  
  class SubClass1: MyClass { }
  class SubSubClass1: SubClass1 { }
  class SubClass2: MyClass { }
  class SubClass3: MyClass { }
  
  let requiredTypes = [SubClass1.self, SubClass2.self]
  
  let instances = [SubSubClass1(), SubClass2()]
  
  let meetsRequirements = requiredTypes.allSatisfy { (requiredType) -&gt; Bool in
      return instances.map({$0 is requiredType}).contains(true)
  }
  </code></pre>