diff options
author | michelou <michelou@epfl.ch> | 2003-06-11 18:31:17 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-06-11 18:31:17 +0000 |
commit | 5c348d28dac57711b938cb1c910b3b95c47445dd (patch) | |
tree | 7777e40dd7886b6e1ab1395bd2c3bbe0a97f6416 /test | |
parent | da93e36d8f40d0484ad45182054814df34cb1595 (diff) | |
download | scala-5c348d28dac57711b938cb1c910b3b95c47445dd.tar.gz scala-5c348d28dac57711b938cb1c910b3b95c47445dd.tar.bz2 scala-5c348d28dac57711b938cb1c910b3b95c47445dd.zip |
*** empty log message ***
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/mics1.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/run/mics1.scala b/test/files/run/mics1.scala new file mode 100644 index 0000000000..3b39a7cabf --- /dev/null +++ b/test/files/run/mics1.scala @@ -0,0 +1,25 @@ +abstract class IntMap[a] { + def lookup(key: Int): a = match { + case Empty() => error("key " + key + " not found") + case _ => error("ok") + } +} + +case class Empty[a]() extends IntMap[a]; + +object mics1 { + + def main(args: Array[String]) = { + val key = 2000; + val map: IntMap[String] = new Empty[String]; + + System.out.print("lookup(" + key + ") = "); + try { + System.out.println(map.lookup(key)); + } except { + case e => System.out.println(e); + } + } + +} + |