summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/mics1.scala25
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);
+ }
+ }
+
+}
+