diff options
author | Dmitry Petrashko <dark@d-d.me> | 2016-01-04 10:46:01 +0100 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2016-01-04 10:46:01 +0100 |
commit | 4bca33233bb11e9a8ef8461b66707c37e8a09184 (patch) | |
tree | b6877e3fc6f9b8cce3eb3cd62a593d15812a0c65 /tests | |
parent | 28c6b5a48122c26aff1a810c8f33c50a3643fd79 (diff) | |
parent | 0290dbcbffd3833e23ad6e206ca6fd1cc56f1415 (diff) | |
download | dotty-4bca33233bb11e9a8ef8461b66707c37e8a09184.tar.gz dotty-4bca33233bb11e9a8ef8461b66707c37e8a09184.tar.bz2 dotty-4bca33233bb11e9a8ef8461b66707c37e8a09184.zip |
Merge pull request #1005 from dotty-staging/ycheck-erasure-arrays
Ycheck that scala.Array is erazed to either Object or JavaArrayType.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/i966.scala | 15 | ||||
-rw-r--r-- | tests/pos/i996.scala | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/pos/i966.scala b/tests/pos/i966.scala new file mode 100644 index 000000000..1fedc0023 --- /dev/null +++ b/tests/pos/i966.scala @@ -0,0 +1,15 @@ +package scala +package collection +package immutable + +import HashMap.{ HashTrieMap, HashMapCollision1, HashMap1 } +import HashSet.{ HashTrieSet, HashSetCollision1, HashSet1 } + +object i996{ + + private[this] def collisionToArray[T](x: Iterable[T]): Array[Iterable[T]] = (x match { + case x: HashMapCollision1[_, _] => x.kvs.map(x => HashMap(x)).toArray + case x: HashSetCollision1[_] => x.ks.map(x => HashSet(x)).toArray + }).asInstanceOf[Array[Iterable[T]]] + +} diff --git a/tests/pos/i996.scala b/tests/pos/i996.scala new file mode 100644 index 000000000..1fedc0023 --- /dev/null +++ b/tests/pos/i996.scala @@ -0,0 +1,15 @@ +package scala +package collection +package immutable + +import HashMap.{ HashTrieMap, HashMapCollision1, HashMap1 } +import HashSet.{ HashTrieSet, HashSetCollision1, HashSet1 } + +object i996{ + + private[this] def collisionToArray[T](x: Iterable[T]): Array[Iterable[T]] = (x match { + case x: HashMapCollision1[_, _] => x.kvs.map(x => HashMap(x)).toArray + case x: HashSetCollision1[_] => x.ks.map(x => HashSet(x)).toArray + }).asInstanceOf[Array[Iterable[T]]] + +} |