Permalink
Browse files

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.
  • Loading branch information...
1 parent 0c59fc9 commit c26a8db067e4f04ef959bb9a8402fa3e931c3cd7 @paulp paulp committed Feb 11, 2013
Showing with 752 additions and 665 deletions.
  1. +4 −4 src/compiler/scala/tools/nsc/doc/Settings.scala
  2. +2 −2 src/compiler/scala/tools/nsc/interactive/REPL.scala
  3. +49 −295 src/library/scala/Console.scala
  4. +1 −1 src/library/scala/LowPriorityImplicits.scala
  5. +87 −63 src/library/scala/Predef.scala
  6. +53 −0 src/library/scala/io/AnsiColor.scala
  7. +228 −0 src/library/scala/io/ReadStdin.scala
  8. +1 −0 src/library/scala/runtime/RichException.scala
  9. +3 −0 src/library/scala/runtime/SeqCharSequence.scala
  10. +1 −0 src/library/scala/runtime/StringAdd.scala
  11. +1 −0 src/library/scala/runtime/StringFormat.scala
  12. +2 −0 test/files/instrumented/InstrumentationTest.check
  13. +5 −5 test/files/neg/classmanifests_new_deprecations.check
  14. +2 −2 test/files/neg/logImplicits.check
  15. +1 −1 test/files/neg/predef-masking.scala
  16. +2 −2 test/files/neg/t1010.scala
  17. +1 −1 test/files/neg/t414.scala
  18. +1 −1 test/files/neg/t421.check
  19. +1 −1 test/files/neg/t421.scala
  20. +2 −2 test/files/neg/t4271.scala
  21. +3 −3 test/files/pos/List1.scala
  22. +3 −3 test/files/pos/depmet_implicit_chaining_zw.scala
  23. +10 −10 test/files/pos/depmet_implicit_norm_ret.scala
  24. +4 −4 test/files/pos/implicits-new.scala
  25. +20 −20 test/files/pos/implicits-old.scala
  26. +3 −3 test/files/pos/relax_implicit_divergence.scala
  27. +1 −1 test/files/pos/simple-exceptions.scala
  28. +3 −3 test/files/pos/spec-asseenfrom.scala
  29. +5 −5 test/files/pos/spec-cyclic.scala
  30. +4 −4 test/files/pos/spec-sealed.scala
  31. +8 −8 test/files/pos/spec-sparsearray-new.scala
  32. +7 −7 test/files/pos/spec-sparsearray-old.scala
  33. +6 −6 test/files/pos/spec-traits.scala
  34. +3 −3 test/files/pos/t0031.scala
  35. +2 −2 test/files/pos/t0227.scala
  36. +2 −2 test/files/pos/t2331.scala
  37. +7 −7 test/files/pos/t2421.scala
  38. +5 −5 test/files/pos/t2429.scala
  39. +2 −2 test/files/pos/t2797.scala
  40. +5 −5 test/files/pos/t3152.scala
  41. +3 −3 test/files/pos/t3252.scala
  42. +2 −2 test/files/pos/t3349/Test.scala
  43. +2 −2 test/files/pos/t3363-new.scala
  44. +1 −1 test/files/pos/t3363-old.scala
  45. +5 −5 test/files/pos/t3440.scala
  46. +2 −2 test/files/pos/t3477.scala
  47. +2 −2 test/files/pos/t3731.scala
  48. +4 −4 test/files/pos/t3883.scala
  49. +2 −2 test/files/pos/t3927.scala
  50. +9 −9 test/files/pos/tcpoly_boundedmonad.scala
  51. +4 −4 test/files/pos/tcpoly_infer_explicit_tuple_wrapper.scala
  52. +2 −2 test/files/pos/tcpoly_infer_implicit_tuple_wrapper.scala
  53. +9 −9 test/files/pos/tcpoly_overloaded.scala
  54. +1 −1 test/files/pos/tcpoly_subst.scala
  55. +2 −2 test/files/pos/tcpoly_variance_pos.scala
  56. +1 −1 test/files/pos/tcpoly_wildcards.scala
  57. +7 −7 test/files/pos/typealias_dubious.scala
  58. +2 −2 test/files/pos/virtpatmat_binding_opt.scala
  59. +2 −1 test/files/presentation/callcc-interpreter.check
  60. +2 −1 test/files/presentation/ide-bug-1000349.check
  61. +6 −3 test/files/presentation/ide-bug-1000475.check
  62. +2 −1 test/files/presentation/ide-bug-1000531.check
  63. +2 −1 test/files/presentation/implicit-member.check
  64. +4 −2 test/files/presentation/ping-pong.check
  65. +2 −1 test/files/presentation/t5708.check
  66. +10 −5 test/files/presentation/visibility.check
  67. +12 −12 test/files/run/Course-2002-07.scala
  68. +2 −2 test/files/run/Course-2002-08.scala
  69. +6 −6 test/files/run/Course-2002-09.scala
  70. +2 −2 test/files/run/Course-2002-13.scala
  71. +8 −5 test/files/run/analyzerPlugins.check
  72. +1 −0 test/files/run/array-charSeq.scala
  73. +1 −1 test/files/run/arrays.scala
  74. +25 −25 test/files/run/exceptions-2.scala
  75. +2 −2 test/files/run/exceptions.scala
  76. +4 −4 test/files/run/exoticnames.scala
  77. +6 −5 test/files/run/genericValueClass.scala
  78. +1 −1 test/files/run/macro-typecheck-implicitsdisabled.check
  79. +1 −1 test/files/run/runtime.scala
  80. +1 −1 test/files/run/t1042.scala
  81. +9 −9 test/files/run/tailcalls.scala
  82. +1 −1 test/files/run/toolbox_typecheck_implicitsdisabled.check
  83. +8 −8 test/files/run/try-2.scala
  84. +5 −5 test/files/run/try.scala
  85. +1 −1 test/files/run/verify-ctor.scala
  86. +14 −14 test/files/scalacheck/CheckEither.scala
  87. +2 −2 test/scaladoc/resources/SI_4715.scala
@@ -315,10 +315,10 @@ class Settings(error: String => Unit, val printMsg: String => Unit = println(_))
/** Common conversion targets that affect any class in Scala */
val commonConversionTargets = Set(
- "scala.Predef.any2stringfmt",
- "scala.Predef.any2stringadd",
- "scala.Predef.any2ArrowAssoc",
- "scala.Predef.any2Ensuring",
+ "scala.Predef.StringFormat",
+ "scala.Predef.StringAdd",
+ "scala.Predef.ArrowAssoc",
+ "scala.Predef.Ensuring",
"scala.collection.TraversableOnce.alternateImplicit")
/** There's a reason all these are specialized by hand but documenting each of them is beyond the point */
@@ -59,7 +59,7 @@ object REPL {
def main(args: Array[String]) {
process(args)
- /*sys.*/exit(if (reporter.hasErrors) 1 else 0)// Don't use sys yet as this has to run on 2.8.2 also.
+ sys.exit(if (reporter.hasErrors) 1 else 0)
}
def loop(action: (String) => Unit) {
@@ -182,7 +182,7 @@ object REPL {
println(instrument(arguments, line.toInt))
case List("quit") =>
comp.askShutdown()
- exit(1) // Don't use sys yet as this has to run on 2.8.2 also.
+ sys.exit(1)
case List("structure", file) =>
doStructure(file)
case _ =>
Oops, something went wrong.

0 comments on commit c26a8db

Please sign in to comment.