diff options
author | michelou <michelou@epfl.ch> | 2007-03-16 13:34:42 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-03-16 13:34:42 +0000 |
commit | 3d4d7ce3ef2ef6a42c8e4f035058b4e5e76b88b1 (patch) | |
tree | a86e3c6829ef976c9e874c6ef9762ee43e34f420 /src/library/scala/MatchError.scala | |
parent | 6d93465512f46b7e26226ef565e399adc63b993c (diff) | |
download | scala-3d4d7ce3ef2ef6a42c8e4f035058b4e5e76b88b1.tar.gz scala-3d4d7ce3ef2ef6a42c8e4f035058b4e5e76b88b1.tar.bz2 scala-3d4d7ce3ef2ef6a42c8e4f035058b4e5e76b88b1.zip |
added Array.deepToString, cleaned up MatchError
Diffstat (limited to 'src/library/scala/MatchError.scala')
-rw-r--r-- | src/library/scala/MatchError.scala | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/src/library/scala/MatchError.scala b/src/library/scala/MatchError.scala index a51504a73c..8c0fd2279e 100644 --- a/src/library/scala/MatchError.scala +++ b/src/library/scala/MatchError.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -21,35 +21,7 @@ import Predef._ * @author Martin Odersky * @version 1.1, 05/03/2004 */ -object MatchError { - - def string(obj: Any) = - if (null != obj) obj.toString() else "null" - -/* //bq: pattern matcher doesn't use these methods anymore - // todo: change pattern matcher so that dummy type parameter T can be removed. - def fail[T](source: String, line: Int): Nothing = - throw new MatchError(source, line) - - def report(source: String, line: Int, obj: Any) = - try { - throw new MatchError(source, line, string(obj)) - } catch { - case e: MatchError => throw e - case e: Throwable => throw new MatchError(source, line) - } - */ -} - final class MatchError(msg: String) extends RuntimeException(msg) { -/* //bq: pattern matcher doesn't use these constructors anymore - def this(source: String, line: Int) = - this(" in '" + source + "' at line " + line) - - def this(source: String, line: Int, obj: String) = - this("for object " + obj + " in '" + source + "' at line " + line) -*/ - def this(obj: Any) = - this(MatchError.string(obj)) + this(if (null != obj) obj.toString() else "null") } |