From 5a84bffb2c2be9bb3dfb0778e946996a652fbc14 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 1 Jul 2010 18:29:45 +0000 Subject: Test case for #1974, which was fixed at some po... Test case for #1974, which was fixed at some point even though martin says in the comments it wouldn't be fixed for 2.8. Take that, things which think they won't be fixed which really will be. Closes #1974, no review. --- test/files/pos/bug1974.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/files/pos/bug1974.scala (limited to 'test/files/pos') diff --git a/test/files/pos/bug1974.scala b/test/files/pos/bug1974.scala new file mode 100644 index 0000000000..a0daa13c21 --- /dev/null +++ b/test/files/pos/bug1974.scala @@ -0,0 +1,20 @@ +object Broken { + private var map = Map[Class[_], String]() + + def addToMap(c : Class[_], s : String) = map += (c -> s) + def fetch(c : Class[_]) = map(c) +} + +object Works { + private var map = Map[Class[_], String]() + + def addToMap(c : Class[_], s : String) = map += ((c, s)) + def fetch(c : Class[_]) = map(c) +} + +object Works2 { + private var map = Map[Class[_], String]() + + def addToMap(c : Class[_], s : String) = map += ((c : Class[_]) -> s) + def fetch(c : Class[_]) = map(c) +} \ No newline at end of file -- cgit v1.2.3