title: Use Self as generic type
body: <p><code>Self</code> can be used as the return type of a method:</p>
  
  <pre><code>func doSomething() -&gt; Self {}
  </code></pre>
  
  <p>Is it somehow possible to use <code>Self</code> as a generic type like this?</p>
  
  <pre><code>func doSomething() -&gt; Wrapper&lt;Self&gt; {}
  </code></pre>
  
  <p><strong>Example</strong></p>
  
  <p>It would be nice if I could subclass ChristmasPresent and let it have a <code>wrapped</code> function that returns a WrappedPresent with the generic set to whatever the subclass was.</p>
  
  <pre><code>class ChristmasPresent {
      func wrapped() -&gt; WrappedPresent&lt;Self&gt; {
          return WrappedPresent(present: self)
      }
  }
  
  class WrappedPresent&lt;T: ChristmasPresent&gt; {
      var present: T
  
      init(present: T) {
          self.present = present
      }
  }
  
  class ToyCar: ChristmasPresent {}
  
  let wrappedToyCar = ToyCar().wrapped() // Inferred to be: WrappedPresent&lt;ToyCar&gt; 
  </code></pre>