summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/reflect/NameTransformer.scala19
-rw-r--r--src/library/scala/util/Either.scala28
-rw-r--r--src/library/scala/util/Properties.scala2
3 files changed, 24 insertions, 25 deletions
diff --git a/src/library/scala/reflect/NameTransformer.scala b/src/library/scala/reflect/NameTransformer.scala
index ae36f5edc2..bdf5165df5 100644
--- a/src/library/scala/reflect/NameTransformer.scala
+++ b/src/library/scala/reflect/NameTransformer.scala
@@ -13,15 +13,16 @@ package reflect
* Also provides some constants.
*/
object NameTransformer {
- // XXX Short term: providing a way to alter these without having to recompile
- // the compiler before recompiling the compiler.
- val MODULE_SUFFIX_STRING = sys.props.getOrElse("SCALA_MODULE_SUFFIX_STRING", "$")
- val NAME_JOIN_STRING = sys.props.getOrElse("SCALA_NAME_JOIN_STRING", "$")
- val MODULE_INSTANCE_NAME = "MODULE$"
- val LOCAL_SUFFIX_STRING = " "
- val LAZY_LOCAL_SUFFIX_STRING = "$lzy"
- val SETTER_SUFFIX_STRING = "_$eq"
- val TRAIT_SETTER_SEPARATOR_STRING = "$_setter_$"
+ // TODO: reduce duplication with and in StdNames
+ // I made these constants because we cannot change them without bumping our major version anyway.
+ final val NAME_JOIN_STRING = "$"
+ final val MODULE_SUFFIX_STRING = "$"
+ final val MODULE_INSTANCE_NAME = "MODULE$"
+ final val LOCAL_SUFFIX_STRING = " "
+ final val LAZY_LOCAL_SUFFIX_STRING = "$lzy"
+ final val MODULE_VAR_SUFFIX_STRING = "$module"
+ final val SETTER_SUFFIX_STRING = "_$eq"
+ final val TRAIT_SETTER_SEPARATOR_STRING = "$_setter_$"
private val nops = 128
private val ncodes = 26 * 26
diff --git a/src/library/scala/util/Either.scala b/src/library/scala/util/Either.scala
index 169786d31b..c332f18295 100644
--- a/src/library/scala/util/Either.scala
+++ b/src/library/scala/util/Either.scala
@@ -95,13 +95,15 @@ sealed abstract class Either[+A, +B] extends Product with Serializable {
/**
* Projects this `Either` as a `Left`.
*/
- @deprecated("use swap instead", "2.12.0")
def left = Either.LeftProjection(this)
/**
* Projects this `Either` as a `Right`.
+ *
+ * Because `Either` is right-biased, this method is not normally needed.
+ * (It is retained in the API for now for easy cross-compilation between Scala
+ * 2.11 and 2.12.)
*/
- @deprecated("Either is now right-biased", "2.12.0")
def right = Either.RightProjection(this)
/**
@@ -245,7 +247,7 @@ sealed abstract class Either[+A, +B] extends Product with Serializable {
/**
* Returns `true` if `Left` or returns the result of the application of
- * the given function to the `Right` value.
+ * the given predicate to the `Right` value.
*
* {{{
* Right(12).forall(_ > 10) // true
@@ -260,7 +262,7 @@ sealed abstract class Either[+A, +B] extends Product with Serializable {
/**
* Returns `false` if `Left` or returns the result of the application of
- * the given function to the `Right` value.
+ * the given predicate to the `Right` value.
*
* {{{
* Right(12).exists(_ > 10) // true
@@ -426,7 +428,10 @@ object Either {
/**
* Projects an `Either` into a `Left`.
*
- * This allows for-comprehensions over Either instances - for example {{{
+ * This allows for-comprehensions over the left side of Either instances,
+ * reversing Either's usual right-bias.
+ *
+ * For example {{{
* for (s <- Left("flower").left) yield s.length // Left(6)
* }}}
*
@@ -472,7 +477,6 @@ object Either {
* @author <a href="mailto:research@workingmouse.com">Tony Morris</a>, Workingmouse
* @version 1.0, 11/10/2008
*/
- @deprecated("use swap instead", "2.12.0")
final case class LeftProjection[+A, +B](e: Either[A, B]) {
/**
* Returns the value from this `Left` or throws `java.util.NoSuchElementException`
@@ -624,19 +628,13 @@ object Either {
/**
* Projects an `Either` into a `Right`.
*
- * This allows for-comprehensions over Either instances - for example {{{
- * for (s <- Right("flower").right) yield s.length // Right(6)
- * }}}
- *
- * Continuing the analogy with [[scala.Option]], a `RightProjection` declares
- * that `Right` should be analogous to `Some` in some code.
- *
- * Analogous to `LeftProjection`, see example usage in its documentation above.
+ * Because `Either` is already right-biased, this class is not normally needed.
+ * (It is retained in the library for now for easy cross-compilation between Scala
+ * 2.11 and 2.12.)
*
* @author <a href="mailto:research@workingmouse.com">Tony Morris</a>, Workingmouse
* @version 1.0, 11/10/2008
*/
- @deprecated("Either is now right-biased", "2.12.0")
final case class RightProjection[+A, +B](e: Either[A, B]) {
/**
diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala
index a176748cd6..fc2302d148 100644
--- a/src/library/scala/util/Properties.scala
+++ b/src/library/scala/util/Properties.scala
@@ -105,7 +105,7 @@ private[scala] trait PropertiesTrait {
* or "version (unknown)" if it cannot be determined.
*/
val versionString = "version " + scalaPropOrElse("version.number", "(unknown)")
- val copyrightString = scalaPropOrElse("copyright.string", "Copyright 2002-2016, LAMP/EPFL")
+ val copyrightString = scalaPropOrElse("copyright.string", "Copyright 2002-2016, LAMP/EPFL and Lightbend, Inc.")
/** This is the encoding to use reading in source files, overridden with -encoding.
* Note that it uses "prop" i.e. looks in the scala jar, not the system properties.