title: How are default constructors's arguments turned into fields?
body: <p>I am running simple code in Scala REPL that creates two classes with a single <code>Int</code> value <code>x</code>. Here's how:  </p>
  
  <pre><code>scala&gt; class C(x: Int){}
  defined class C
  
  scala&gt; new C(100).x
  &lt;console&gt;:13: error: value x is not a member of C
         new C(100).x
                    ^
  
  scala&gt; class D(val x: Int){}
  defined class D
  
  scala&gt; new D(100).x
  res1: Int = 100 
  </code></pre>
  
  <p>My understanding was that for class <code>C</code> the variable <code>x</code> would become a mutable variable (<code>var</code> by default) and for class D an immutable variable. However, I have run into this issue where <code>x</code> isn't a member of <code>C</code>.  </p>
  
  <p>How so?</p>