title: scala case class private apply method( repl bug ?)
body: <p>in Scala2.10.0 REPL</p>
  
  <pre class="lang-scala prettyprint-override"><code>Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_13).
  Type in expressions to have them evaluated. 
  Type :help for more information.
  
  scala&gt; case class A private(i:Int)
  defined class A
  
  scala&gt; A(1)
  res0: A = A(1)
  </code></pre>
  
  <p>But if compile
  </p>
  
  <pre><code>$ scala -version
  Scala code runner version 2.10.0 -- Copyright 2002-2012, LAMP/EPFL
  $ cat Main.scala 
  package foo
  
  case class A private (i:Int)
  
  object Main extends App{
    println(A(1))
  }
  
  $ scalac Main.scala 
  Main.scala:6: error: constructor A in class A cannot be accessed in object Main
    println(A(1))
            ^
  one error found
  </code></pre>
  
  <p><code>A.apply(1)</code> is compile error.</p>
  
  <p>is this Scala2.10.0 REPL bug?</p>
  
  <p>FYI Scala2.9.2 REPL is following</p>
  
  <pre class="lang-scala prettyprint-override"><code>Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_13).
  Type in expressions to have them evaluated.
  Type :help for more information.
  
  scala&gt; case class A private(i:Int)
  defined class A
  
  scala&gt; A(1)
  &lt;console&gt;:10: error: constructor A in class A cannot be accessed in object $iw
                A(1)
                ^
  </code></pre>