diff options
-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] |