scala/scala — pull request #3046 by retronym (2013-10-17 12:25:53+00:00)
Title: Make arguments to implicit value classes private

So that they aren't offered as an autocomplete suggestion:

implicit class Shouty(string: String) extends AnyVal {
def SHOUT_! = string.toUpperCase + "!"
}
"". // autocompletion offers `.string` here offer.

The original incarnation of value classes didn't allow this sort of
encapsulation, so we either invented goofy names like
`__thingToAdd` or just picked `x` or `self`. But SI-7859 has delivered us the
freedom to keep the accessor private.

Should we keep any of these accessors around in a deprecated form?

The implicit classes in Predef were added in 2.11.0-M2
(c26a8db067e4f), so they are okay.

I think we can make reason that these APIs were both accidental and unlikely
to be interpreted as public, so we can break them immediately.

scala> Left(1).x
res0: scala.util.Either[Int,Int] = Left(1)

scala> import concurrent.duration._
import concurrent.duration._

scala> 1.n
res1: Int = 1