diff options
author | Paul Phillips <paulp@improving.org> | 2010-07-01 18:29:45 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-07-01 18:29:45 +0000 |
commit | 5a84bffb2c2be9bb3dfb0778e946996a652fbc14 (patch) | |
tree | 7907662b4caff82085e4210fe158f6131807a7a1 /test/files/pos/bug1974.scala | |
parent | 6abc0a3ebfc305351d88db13199b5c672c0cfe86 (diff) | |
download | scala-5a84bffb2c2be9bb3dfb0778e946996a652fbc14.tar.gz scala-5a84bffb2c2be9bb3dfb0778e946996a652fbc14.tar.bz2 scala-5a84bffb2c2be9bb3dfb0778e946996a652fbc14.zip |
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.
Diffstat (limited to 'test/files/pos/bug1974.scala')
-rw-r--r-- | test/files/pos/bug1974.scala | 20 |
1 files changed, 20 insertions, 0 deletions
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 |