diff options
-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 |