title: Initializing an anonymous class with a trait
body: <p>Can someone help me understand the following behavior? </p>
  
  <p>Simply put: what is the difference between the following two cases where...</p>
  
  <h3>I define a simple class <code>c</code> + trait <code>t</code></h3>
  
  <pre><code>scala&gt; class c {val x=true; val y=this.x} 
  defined class c
  
  scala&gt; trait t {}
  defined trait t
  </code></pre>
  
  <h3>I can instantiate a new "c with t"</h3>
  
  <pre><code>scala&gt; new c with t
  res32: c with t = $anon$1@604f1a67
  </code></pre>
  
  <h3>But I can't instantiate a new "[anonymous class just like c] with t"</h3>
  
  <pre><code>scala&gt; new {val x=true; val y=this.x} with t
  &lt;console&gt;:9: error: type mismatch;
   found   : type
   required: ?{def x: ?}
  &lt;console&gt;:9: error: value x is not a member of object $iw
                new {val x=true; val y=this.x} with t
  </code></pre>
  
  <p>What's the difference between these two cases?</p>
  
  <p>Thanks!</p>