diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-06-25 09:45:27 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-07-13 15:31:16 +0200 |
commit | ef536f00d9d480f28db3093b9dc09a90041cfb74 (patch) | |
tree | ca82afa7a37ce866978b0b66904941672f2dacc3 /tests/run/unapplyArray.scala | |
parent | 9185428b63b138f8c05ade5592e59956296b5128 (diff) | |
download | dotty-ef536f00d9d480f28db3093b9dc09a90041cfb74.tar.gz dotty-ef536f00d9d480f28db3093b9dc09a90041cfb74.tar.bz2 dotty-ef536f00d9d480f28db3093b9dc09a90041cfb74.zip |
Enable 61 tests that succeed.
Diffstat (limited to 'tests/run/unapplyArray.scala')
-rw-r--r-- | tests/run/unapplyArray.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/run/unapplyArray.scala b/tests/run/unapplyArray.scala new file mode 100644 index 000000000..a29ef124b --- /dev/null +++ b/tests/run/unapplyArray.scala @@ -0,0 +1,31 @@ +object Test { + def main(args:Array[String]): Unit = { + val z = Array(1,2,3,4) + val zs: Seq[Int] = z + val za: Any = z + +/* + Console.println("z is arr[int]"+z.isInstanceOf[Array[int]]) + Console.println("zs is arr[int]"+zs.isInstanceOf[Array[int]]) + Console.println("za is arr[int]"+ za.isInstanceOf[Array[int]]) + + Console.println("z is seq[int]"+z.isInstanceOf[Seq[int]]) + Console.println("zs is seq[int]"+zs.isInstanceOf[Seq[int]]) + Console.println("za is seq[int]"+ za.isInstanceOf[Seq[int]]) + + Console.println("z is anyref"+z.isInstanceOf[AnyRef]) + + Console.println("z useq "+ Seq.unapplySeq(z)) + Console.println("zs useq "+ Seq.unapplySeq(zs)) + Console.println("za useq "+ Seq.unapplySeq(za)) + + Console.println("z aseq "+ Seq.unapplySeq(z)) + Console.println("zs aseq "+ Seq.unapplySeq(zs)) + Console.println("za aseq "+ Seq.unapplySeq(za)) +*/ + val zl = zs match { + case Seq(xs:_*) => xs.length + } + assert(zl == 4) + } +} |