diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-28 22:10:37 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-28 22:12:51 +0100 |
commit | 91c61e4694097971b9a0c139048b7239d0f05588 (patch) | |
tree | 6836b169dce43f32e588f60bb16d14dba850b254 /tests/pos/new-array.scala | |
parent | b18ce863f5f2444a5a00ccc9d55c4ee12115c467 (diff) | |
download | dotty-91c61e4694097971b9a0c139048b7239d0f05588.tar.gz dotty-91c61e4694097971b9a0c139048b7239d0f05588.tar.bz2 dotty-91c61e4694097971b9a0c139048b7239d0f05588.zip |
Previous scheme was buggy; leaked Array types to backend.
Now: All new Array[T] methods are translated to calls of the form
dotty.Arrays.newXYZArray ...
Diffstat (limited to 'tests/pos/new-array.scala')
-rw-r--r-- | tests/pos/new-array.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/new-array.scala b/tests/pos/new-array.scala new file mode 100644 index 000000000..9deb2330a --- /dev/null +++ b/tests/pos/new-array.scala @@ -0,0 +1,14 @@ +object Test { + val w = new Array[String](10) + val x = new Array[Int](10) + def f[T: reflect.ClassTag] = new Array[T](10) + val y = new Array[Any](10) + val z = new Array[Unit](10) +} +object Test2 { + val w: Array[String] = new Array(10) + val x: Array[Int] = new Array(10) + def f[T: reflect.ClassTag]: Array[T] = new Array(10) + val y: Array[Any] = new Array(10) + val z: Array[Unit] = new Array(10) +} |