title: Expression of type doesn't conform to Expected type B
body: <p>I have following code to understand covariant and lower bound, I intentionally make the code have compiling errors.</p>
  
  <p>The <code>getOrElse</code> works, which is similar from the <code>getOrElse</code> method of Option[+T].</p>
  
  <p>I would ask why <code>getOrElse2</code> and <code>getOrElse3</code> don't work to better understand covariant and lower bound.</p>
  
  <p>The compiling error is pasted as comments in the code:</p>
  
  <pre><code>class  MyOption[+A](val x: A) {
    def get():A = x
  
    //similar to Option.getOrElse,which works
    def getOrElse[B&gt;:A ](default: =&gt; B): B = {
      if (x != null) x else  default
    }
  
    //Compiling Error: Expression of type A doesn't conform to Expected type B
    def getOrElse2[B, A&lt;:B ](default: =&gt; B): B = {
      if (x != null) x else  default
    }
  
    //Covariant type A occurs in controvariant position in type A of value B
    def getOrElse3[B &lt;: A](default:=&gt;B): A = {
      if (x != null) x else  default
    }
  }
  </code></pre>