title: scala self generic illegal inheritance
body: <p>Basicaly this is what I am trying to do.
  A trait that has a member and another trait that inherits that member and initialize it.
  Then a class that takes a generic type that must be inherited from the first trait and accesses that member</p>
  
  <pre><code>object main extends App{
  val z =  new c[b]()
    z.p()
  }
  
  trait a{
    val x : String
  }
  
  trait b extends a {
    val x = 1
  }
  
  class c [A &lt;: a]  {
    self: A =&gt;
    def p(): Unit ={
      print(x)
    }
  }
  </code></pre>
  
  <p>but in the line </p>
  
  <pre><code>val z =  new c[b]()
  </code></pre>
  
  <p>c[b] is underlined and the compiler complains that </p>
  
  <blockquote>
    <p>"Illegal inheritance, self-type c[b] does not conform to A"</p>
  </blockquote>
  
  <p>I want to define multiple traits that inherit from a father trait and then define a class that takes one of the fathers child traits and accesses its values</p>