summaryrefslogtreecommitdiff
path: root/src/library/scala/MatchError.scala
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-03-15 15:56:44 +0000
committerBurak Emir <emir@epfl.ch>2007-03-15 15:56:44 +0000
commit16bbef1243277fd99efa1ce80cb35b904f4001ac (patch)
tree9c9ca751c0c7843b030291056bd8bb0980b8ec26 /src/library/scala/MatchError.scala
parent8a799ca9851e83fc9acae686b2335660de04cd72 (diff)
downloadscala-16bbef1243277fd99efa1ce80cb35b904f4001ac.tar.gz
scala-16bbef1243277fd99efa1ce80cb35b904f4001ac.tar.bz2
scala-16bbef1243277fd99efa1ce80cb35b904f4001ac.zip
is an exception now rather than an error
Diffstat (limited to 'src/library/scala/MatchError.scala')
-rw-r--r--src/library/scala/MatchError.scala8
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))