From e26f5c412a2498c23c8cc3e975208a71f8f7d558 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 24 May 2013 05:43:58 -0700 Subject: SI-7088 Array crasher in erasure. The usual business where half our pattern matches are missing half the necessary cases. --- test/files/run/t7088.check | 2 ++ test/files/run/t7088.scala | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/files/run/t7088.check create mode 100644 test/files/run/t7088.scala (limited to 'test') diff --git a/test/files/run/t7088.check b/test/files/run/t7088.check new file mode 100644 index 0000000000..1191247b6d --- /dev/null +++ b/test/files/run/t7088.check @@ -0,0 +1,2 @@ +1 +2 diff --git a/test/files/run/t7088.scala b/test/files/run/t7088.scala new file mode 100644 index 0000000000..5f0114b940 --- /dev/null +++ b/test/files/run/t7088.scala @@ -0,0 +1,13 @@ +object Test { + type Tag[X] = {type Tag = X} + type TaggedArray[T] = Array[T] with Tag[Any] + + def method[T: scala.reflect.ClassTag](a: TaggedArray[T], value: T) { + a.update(0, value) + a foreach println + } + + def main(args: Array[String]): Unit = { + method(Array(1, 2).asInstanceOf[TaggedArray[Int]], 1) + } +} -- cgit v1.2.3