aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-22 16:17:29 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-24 18:56:48 +0100
commit23969f6e10a16b51d23c3da3f29b4f7edaef6e5a (patch)
tree4b040a012e751116339c5b29d4acbccb02f137b9 /tests
parentc673f2dc2be0e055bd08522f6e91ff704dc43e93 (diff)
downloaddotty-23969f6e10a16b51d23c3da3f29b4f7edaef6e5a.tar.gz
dotty-23969f6e10a16b51d23c3da3f29b4f7edaef6e5a.tar.bz2
dotty-23969f6e10a16b51d23c3da3f29b4f7edaef6e5a.zip
Discard inaccessible denotations when merging.
When froming the &=merge of two denotations, we now discard denotations which have inaccessible symbols. The reason for this change is that, without it, the following code gives the warning "cannot merge Int and Int() as members of one type, keeping only Int()". val m = new java.util.HashMap m.size Indeed java.util.HashMap has a filed and method which are both named size. The field is package private, so is inaccessible from outside java.util, however.
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/test.scala8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/pos/test.scala b/tests/pos/test.scala
index 18741481a..71fa1b1d9 100644
--- a/tests/pos/test.scala
+++ b/tests/pos/test.scala
@@ -1,8 +1,6 @@
object test {
- import collection.JavaConverters._
-
- private val elems =
- (new java.util.LinkedHashMap[String, List[Int]]).asScala
- val elems2: collection.mutable.Map[String, List[Int]] = elems
+ val m = new java.util.HashMap[String, String]
+ m.size
+
} \ No newline at end of file