diff options
author | Burak Emir <emir@epfl.ch> | 2007-03-15 15:56:44 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-03-15 15:56:44 +0000 |
commit | 16bbef1243277fd99efa1ce80cb35b904f4001ac (patch) | |
tree | 9c9ca751c0c7843b030291056bd8bb0980b8ec26 /src | |
parent | 8a799ca9851e83fc9acae686b2335660de04cd72 (diff) | |
download | scala-16bbef1243277fd99efa1ce80cb35b904f4001ac.tar.gz scala-16bbef1243277fd99efa1ce80cb35b904f4001ac.tar.bz2 scala-16bbef1243277fd99efa1ce80cb35b904f4001ac.zip |
is an exception now rather than an error
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/MatchError.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/library/scala/MatchError.scala b/src/library/scala/MatchError.scala index 57ada9efbd..0875b94671 100644 --- a/src/library/scala/MatchError.scala +++ b/src/library/scala/MatchError.scala @@ -24,8 +24,9 @@ import Predef._ object MatchError { def string(obj: Any) = - if (null != obj) obj.toString() else "null" + if (null ne 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) @@ -37,14 +38,17 @@ object MatchError { case e: MatchError => throw e case e: Throwable => throw new MatchError(source, line) } + */ } -final class MatchError(msg: String) extends Error(msg) { +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)) |