title: Rationale for behaviour overriding a val
body: <pre><code>class A { 
    val x = println("A") 
  }
  class B extends A {
    override val x = println("B")
  }
  (new B).x
  </code></pre>
  
  <p>Prints:</p>
  
  <pre><code>A
  B
  </code></pre>
  
  <p>However, </p>
  
  <pre><code>class A { 
    lazy val x = println("A") 
  }
  class B extends A {
    override lazy val x = println("B")
  }
  (new B).x
  </code></pre>
  
  <p>Prints just:</p>
  
  <pre><code>B
  </code></pre>
  
  <p><a href="http://scala-programming-language.1934581.n4.nabble.com/Overriding-val-and-initialization-td1951394.html" rel="noreferrer">According to Martin Odersky</a>, the behaviour, at least in the non-lazy case, is "as specified". I'm curious as to why the behaviour is specified that way, and why it differs when the val is lazy.</p>