diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-10-17 14:15:28 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-12 07:29:42 -0800 |
commit | e2a34984527c0437cd42476934d0c22164551eed (patch) | |
tree | c307db47765519f290f5165694445072935a1ec6 /test/files/presentation/ide-bug-1000475.check | |
parent | beed16825e53077c40ff38b035bfaafb3a4e39d5 (diff) | |
download | scala-e2a34984527c0437cd42476934d0c22164551eed.tar.gz scala-e2a34984527c0437cd42476934d0c22164551eed.tar.bz2 scala-e2a34984527c0437cd42476934d0c22164551eed.zip |
Make parameters 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
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
Diffstat (limited to 'test/files/presentation/ide-bug-1000475.check')
-rw-r--r-- | test/files/presentation/ide-bug-1000475.check | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/test/files/presentation/ide-bug-1000475.check b/test/files/presentation/ide-bug-1000475.check index e4b8508846..cb7de6d34a 100644 --- a/test/files/presentation/ide-bug-1000475.check +++ b/test/files/presentation/ide-bug-1000475.check @@ -3,7 +3,7 @@ reload: Foo.scala askTypeCompletion at Foo.scala(3,7) ================================================================================ [response] askCompletionAt (3,7) -retrieved 35 members +retrieved 31 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit def +(other: String): String @@ -32,16 +32,12 @@ final def synchronized[T0](x$1: T0): T0 final def wait(): Unit final def wait(x$1: Long): Unit final def wait(x$1: Long,x$2: Int): Unit -private[this] val __leftOfArrow: Object -private[this] val __resultOfEnsuring: Object -private[this] val __stringToFormat: Object -private[this] val __thingToAdd: Object ================================================================================ askTypeCompletion at Foo.scala(6,10) ================================================================================ [response] askCompletionAt (6,10) -retrieved 35 members +retrieved 31 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit def +(other: String): String @@ -70,16 +66,12 @@ final def synchronized[T0](x$1: T0): T0 final def wait(): Unit final def wait(x$1: Long): Unit final def wait(x$1: Long,x$2: Int): Unit -private[this] val __leftOfArrow: Object -private[this] val __resultOfEnsuring: Object -private[this] val __stringToFormat: Object -private[this] val __thingToAdd: Object ================================================================================ askTypeCompletion at Foo.scala(7,7) ================================================================================ [response] askCompletionAt (7,7) -retrieved 35 members +retrieved 31 members [inaccessible] protected[package lang] def clone(): Object [inaccessible] protected[package lang] def finalize(): Unit def +(other: String): String @@ -108,8 +100,4 @@ final def synchronized[T0](x$1: T0): T0 final def wait(): Unit final def wait(x$1: Long): Unit final def wait(x$1: Long,x$2: Int): Unit -private[this] val __leftOfArrow: Object -private[this] val __resultOfEnsuring: Object -private[this] val __stringToFormat: Object -private[this] val __thingToAdd: Object ================================================================================ |