Skip to content

Instantly share code, notes, and snippets.

@jsuereth
Last active August 29, 2015 14:26
Show Gist options
  • Save jsuereth/bf94458a0d03035b58c3 to your computer and use it in GitHub Desktop.
Save jsuereth/bf94458a0d03035b58c3 to your computer and use it in GitHub Desktop.
Frustrating case class issue
scala> case class Foo private(x: Int)
defined class Foo
scala> Foo(5)
res5: Foo = Foo(5)
scala> :paste
// Entering paste mode (ctrl-D to finish)
case class Foo private(x: Int)
Foo.apply(5)
// Exiting paste mode, now interpreting.
<console>:10: error: constructor Foo in class Foo cannot be accessed in object $iw
Foo.apply(5)
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment