diff options
author | Martin Odersky <odersky@gmail.com> | 2011-10-07 14:10:29 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-10-07 14:10:29 +0000 |
commit | 497e6321a0aea209b679c428f1b76219d2920fd3 (patch) | |
tree | 02edd4354b08c1ce5ba1f68f44eedf9bac69e569 | |
parent | e98c864cbb32eba01bbc0e13fe88585aade66245 (diff) | |
download | scala-497e6321a0aea209b679c428f1b76219d2920fd3.tar.gz scala-497e6321a0aea209b679c428f1b76219d2920fd3.tar.bz2 scala-497e6321a0aea209b679c428f1b76219d2920fd3.zip |
Added ??? and NotImplementedError because this ...
Added ??? and NotImplementedError because this seemed to be the
opinion of the majority on the "Adding ??? to Predef?" thread on
scala-internals. No review.
-rw-r--r-- | src/library/scala/NotImplementedError.scala | 19 | ||||
-rw-r--r-- | src/library/scala/Predef.scala | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/library/scala/NotImplementedError.scala b/src/library/scala/NotImplementedError.scala new file mode 100644 index 0000000000..393f4061a6 --- /dev/null +++ b/src/library/scala/NotImplementedError.scala @@ -0,0 +1,19 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +\* */ + + + +package scala + +/** Throwing this exception can be a temporary replacement for a method + * body that remains to be implemented. For instance, the exception is thrown by + * `Predef.???`. + */ +final class NotImplementedError(msg: String) extends Error(msg) { + def this() = this("an implementation is missing") +} diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 54111dceba..27197364c9 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -222,6 +222,11 @@ object Predef extends LowPriorityImplicits { } implicit def any2Ensuring[A](x: A): Ensuring[A] = new Ensuring(x) + /** `???` can be used for marking methods that remain to be implemented. + * @throws A `NotImplementedError` + */ + def ??? : Nothing = throw new NotImplementedError + // tupling ------------------------------------------------------------ type Pair[+A, +B] = Tuple2[A, B] |