aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorDmitry Petrashko <dark@d-d.me>2016-03-02 10:16:05 +0100
committerDmitry Petrashko <dark@d-d.me>2016-03-02 10:16:05 +0100
commitae624660d3cc31e9956d7e537c7a5c7925afda68 (patch)
tree12e28b3db9125c3afbb03c6331326f6fab29ae13 /tests/neg
parent0ae3ef2010b90bf06d76a768b0f0c5aa56c1180a (diff)
parent1d2fe4823bc4c8a69351d49229556ac3a1532778 (diff)
downloaddotty-ae624660d3cc31e9956d7e537c7a5c7925afda68.tar.gz
dotty-ae624660d3cc31e9956d7e537c7a5c7925afda68.tar.bz2
dotty-ae624660d3cc31e9956d7e537c7a5c7925afda68.zip
Merge pull request #1111 from dotty-staging/fix-#1099
Special case pattern matching against abstract types with class tags
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/arrayclone-new.scala38
1 files changed, 0 insertions, 38 deletions
diff --git a/tests/neg/arrayclone-new.scala b/tests/neg/arrayclone-new.scala
deleted file mode 100644
index 0e42545f8..000000000
--- a/tests/neg/arrayclone-new.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-// Run with -explaintypes to see information about shadowing failures
-import scala.reflect.{ClassTag, classTag}
-
-object Test extends dotty.runtime.LegacyApp{
- ObjectArrayClone;
- PolymorphicArrayClone;
-}
-
-object ObjectArrayClone{
- val it : Array[String] = Array("1", "0"); // error
- val cloned = it.clone();
- assert(cloned.sameElements(it));
- cloned(0) = "0";
- assert(it(0) == "1")
-}
-
-object PolymorphicArrayClone{
- def testIt[T](it : Array[T], one : T, zero : T) = {
- val cloned = it.clone();
- assert(cloned.sameElements(it));
- cloned(0) = zero;
- assert(it(0) == one)
- }
-
- testIt(Array("one", "two"), "one", "two"); // error
-
- class Mangler[T: ClassTag](ts : T*){
- // this will always be a BoxedAnyArray even after we've unboxed its contents.
- val it = ts.toArray[T];
- }
-
- val mangled = new Mangler[Int](0, 1);
-
- val y : Array[Int] = mangled.it; // make sure it's unboxed
-
- testIt(mangled.it, 0, 1);
-}
-