From c26a8db067e4f04ef959bb9a8402fa3e931c3cd7 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 11 Feb 2013 08:53:14 -0800 Subject: 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. --- test/files/pos/tcpoly_overloaded.scala | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/files/pos/tcpoly_overloaded.scala') diff --git a/test/files/pos/tcpoly_overloaded.scala b/test/files/pos/tcpoly_overloaded.scala index 4240074d85..4f6334685b 100644 --- a/test/files/pos/tcpoly_overloaded.scala +++ b/test/files/pos/tcpoly_overloaded.scala @@ -1,10 +1,10 @@ trait Monad[T <: Bound[T], MyType[x <: Bound[x]], Bound[_]] { - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], + def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S]): Result[S] - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], + (f: T => Result[S]): Result[S] + def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S], foo: String): Result[S] + (f: T => Result[S], foo: String): Result[S] def flatMap[S <: Bound[S]] (f: T => MyType[S], foo: Int): MyType[S] } @@ -12,14 +12,14 @@ trait Monad[T <: Bound[T], MyType[x <: Bound[x]], Bound[_]] { trait Test { def moo: MList[Int] class MList[T](el: T) extends Monad[T, List, Any] { - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], + def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S]): Result[S] = error("foo") - def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], + (f: T => Result[S]): Result[S] = sys.error("foo") + def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_], Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]] - (f: T => Result[S], foo: String): Result[S] = error("foo") + (f: T => Result[S], foo: String): Result[S] = sys.error("foo") def flatMap[S] - (f: T => List[S], foo: Int): List[S] = error("foo") + (f: T => List[S], foo: Int): List[S] = sys.error("foo") } val l: MList[String] = moo.flatMap[String, List, Any, MList]((x: Int) => new MList("String")) } -- cgit v1.2.3