title: covariant type A occurs in contravariant position in type A of value a
body: <p>I have following class:</p>
  
  <pre><code>case class Box[+A](value: A) {
  
    def set(a: A): Box[A] = Box(a)
  
  }
  </code></pre>
  
  <p>And the compiler complain:</p>
  
  <pre><code>Error:(4, 11) covariant type A occurs in contravariant position in type A of value a
    def set(a: A): Box[A] = Box(a)
  </code></pre>
  
  <p>I was searching a lot about the error, but could not find something useful that 
  help me to understand the error.</p>
  
  <p>Could someone please explain, why the error occurs?  </p>