From 497e6321a0aea209b679c428f1b76219d2920fd3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 7 Oct 2011 14:10:29 +0000 Subject: 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. --- src/library/scala/NotImplementedError.scala | 19 +++++++++++++++++++ src/library/scala/Predef.scala | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 src/library/scala/NotImplementedError.scala (limited to 'src') 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] -- cgit v1.2.3