diff options
author | Paul Phillips <paulp@improving.org> | 2013-02-11 08:53:14 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-02-12 11:01:13 -0800 |
commit | c26a8db067e4f04ef959bb9a8402fa3e931c3cd7 (patch) | |
tree | 8e920c4fd9ae5182c4175ca40d731dd36c004963 /test/files/pos/spec-sparsearray-new.scala | |
parent | 0c59fc9a1416cf5c45699111e8857adb03f7f0d4 (diff) | |
download | scala-c26a8db067e4f04ef959bb9a8402fa3e931c3cd7.tar.gz scala-c26a8db067e4f04ef959bb9a8402fa3e931c3cd7.tar.bz2 scala-c26a8db067e4f04ef959bb9a8402fa3e931c3cd7.zip |
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.
Diffstat (limited to 'test/files/pos/spec-sparsearray-new.scala')
-rw-r--r-- | test/files/pos/spec-sparsearray-new.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/files/pos/spec-sparsearray-new.scala b/test/files/pos/spec-sparsearray-new.scala index 7b3934c476..df31089fe2 100644 --- a/test/files/pos/spec-sparsearray-new.scala +++ b/test/files/pos/spec-sparsearray-new.scala @@ -4,7 +4,7 @@ import scala.collection.mutable.MapLike class SparseArray[@specialized(Int) T:ClassTag] extends collection.mutable.Map[Int,T] with collection.mutable.MapLike[Int,T,SparseArray[T]] { override def get(x: Int) = { val ind = findOffset(x) - if(ind < 0) None else Some(error("ignore")) + if(ind < 0) None else Some(sys.error("ignore")) } /** @@ -13,13 +13,13 @@ class SparseArray[@specialized(Int) T:ClassTag] extends collection.mutable.Map[I * negative and can be converted into an insertion point with -(rv+1). */ private def findOffset(i : Int) : Int = { - error("impl doesn't matter") + sys.error("impl doesn't matter") } - override def apply(i : Int) : T = { error("ignore") } - override def update(i : Int, value : T) = error("ignore") + override def apply(i : Int) : T = { sys.error("ignore") } + override def update(i : Int, value : T) = sys.error("ignore") override def empty = new SparseArray[T] - def -=(ind: Int) = error("ignore") - def +=(kv: (Int,T)) = error("ignore") - override final def iterator = error("ignore") -}
\ No newline at end of file + def -=(ind: Int) = sys.error("ignore") + def +=(kv: (Int,T)) = sys.error("ignore") + override final def iterator = sys.error("ignore") +} |