title: Why must constructing an object of class type 'someClass' with a metatype value use a 'required' initializer?
body: <pre><code>class Animal {
      class func generate() -&gt; Animal {
          return self()
      }
  }
  </code></pre>
  
  <p>The compiler complains <strong>constructing an object of class type 'Animal' with a metatype value must use a 'required' initializer</strong></p>
  
  <p>I can understand this. If I write a subclass like this:</p>
  
  <pre><code>class SubAnimal: Animal {
      let head: Int
      init(head: Int) {
          self.head = head
          super.init()
      }
  }
  </code></pre>
  
  <p>It will inherit <code>Animal</code>'s class method <code>generate()</code> but won't inherit its default initializer <code>init()</code>. So <code>SmallAnimal.generate()</code> actually calls <code>SmallAnimal()</code>, but <code>SmallAnimal</code> doesn't have an initializer <code>init()</code>! Of course this is what the compiler want to prevent.</p>
  
  <p>What confuses me is a similar problem.</p>
  
  <pre><code>class someClass {
  
  }
  let anotherClass = someClass.self
  let anotherObject = anotherClass()
  </code></pre>
  
  <p>The compiler still complains <strong>constructing an object of class type 'Animal' with a metatype value must use a 'required' initializer</strong>. </p>
  
  <p>This time, I cannot understand. <code>anotherClass</code> is a <strong>metatype value</strong>, but what bad result will be caused?</p>
  
  <p>I know how to solve this problem, adding <code>required init() {}</code> is the solution. But I really want to know the reason for the second case.</p>