Skip to content

Commit c26a8db

Browse files
committed
Maintenance of Predef.
1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.
1 parent 0c59fc9 commit c26a8db

File tree

87 files changed

+752
-665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+752
-665
lines changed

src/compiler/scala/tools/nsc/doc/Settings.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
315315

316316
/** Common conversion targets that affect any class in Scala */
317317
val commonConversionTargets = Set(
318-
"scala.Predef.any2stringfmt",
319-
"scala.Predef.any2stringadd",
320-
"scala.Predef.any2ArrowAssoc",
321-
"scala.Predef.any2Ensuring",
318+
"scala.Predef.StringFormat",
319+
"scala.Predef.StringAdd",
320+
"scala.Predef.ArrowAssoc",
321+
"scala.Predef.Ensuring",
322322
"scala.collection.TraversableOnce.alternateImplicit")
323323

324324
/** There's a reason all these are specialized by hand but documenting each of them is beyond the point */

src/compiler/scala/tools/nsc/interactive/REPL.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object REPL {
5959

6060
def main(args: Array[String]) {
6161
process(args)
62-
/*sys.*/exit(if (reporter.hasErrors) 1 else 0)// Don't use sys yet as this has to run on 2.8.2 also.
62+
sys.exit(if (reporter.hasErrors) 1 else 0)
6363
}
6464

6565
def loop(action: (String) => Unit) {
@@ -182,7 +182,7 @@ object REPL {
182182
println(instrument(arguments, line.toInt))
183183
case List("quit") =>
184184
comp.askShutdown()
185-
exit(1) // Don't use sys yet as this has to run on 2.8.2 also.
185+
sys.exit(1)
186186
case List("structure", file) =>
187187
doStructure(file)
188188
case _ =>

0 commit comments

Comments
 (0)