diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t5580b.check | 6 | ||||
-rw-r--r-- | test/files/neg/t5580b.scala | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/t5580b.check b/test/files/neg/t5580b.check new file mode 100644 index 0000000000..45fde46ff9 --- /dev/null +++ b/test/files/neg/t5580b.check @@ -0,0 +1,6 @@ +t5580b.scala:11: error: polymorphic expression cannot be instantiated to expected type; + found : [A]scala.collection.mutable.Set[A] + required: scala.collection.mutable.Map[bar,scala.collection.mutable.Set[bar]] + if (map.get(tmp).isEmpty) map.put(tmp,collection.mutable.Set()) + ^ +one error found diff --git a/test/files/neg/t5580b.scala b/test/files/neg/t5580b.scala new file mode 100644 index 0000000000..2161da4584 --- /dev/null +++ b/test/files/neg/t5580b.scala @@ -0,0 +1,13 @@ +import scala.collection.mutable.WeakHashMap +import scala.collection.JavaConversions._ + +class bar { } + +class foo { + val map = WeakHashMap[AnyRef, collection.mutable.Map[bar, collection.mutable.Set[bar]]]() + + def test={ + val tmp:bar=null + if (map.get(tmp).isEmpty) map.put(tmp,collection.mutable.Set()) + } +} |