summaryrefslogtreecommitdiff
path: root/test/files/run/arraytags_basic.scala
blob: edc20e9bc13a6257b51c30c8687ccf7a5ee51461 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
object Test extends App {
  def test[T: ArrayTag] = {
    println(implicitly[ArrayTag[T]].newArray(10).getClass)
    println(implicitly[ArrayTag[T]].wrap.newArray(10).getClass)
    println(implicitly[ArrayTag[Array[T]]].wrap.newArray(10).getClass)
  }

  test[Int]
  test[List[Int]]
  test[List[String]]
  test[Map[Int, String]]

  test[Array[Int]]
  test[Array[List[Int]]]
  test[Array[List[String]]]
  test[Array[Map[Int, String]]]

  test[Array[Array[Int]]]
  test[Array[Array[List[Int]]]]
  test[Array[Array[List[String]]]]
  test[Array[Array[Map[Int, String]]]]
}