title: Illegal inheritance while extending trait with self type
body: <p>I'm confused by the following code:</p>
  
  <pre><code>    trait T1 {
          type S
      }
  
      trait T2 {
        self: T1 =&gt;
  
         case  class ClS(s: S)
      }
  
      object O extends T2 {
  
      }
  </code></pre>
  
  <p>It gives out the following error message: </p>
  
  <blockquote>
    <p>illegal inheritance;  tests.O.type does not conform to tests.T2's
    selftype tests.T2 with tests.T1</p>
  </blockquote>
  
  <p>What's going wrong? the reason that I extend <code>O</code> with <code>T2</code> is that I want to reference the class <code>CLS</code> in <code>O</code>, how can I achieve that?</p>