aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/erasure-array.scala
blob: 63240e9801f0dfea34c6d850ed499be87c875269 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                  
// https://github.com/lampepfl/dotty/issues/1065
package hello

object world {
  def mkArray(atype: Int): Array[_ <: AnyVal] = {
    (if (atype == 1) new Array[Int](10) else new Array[Float](10))
  }

  def main(args: Array[String]): Unit = {
    println(mkArray(1))
  }
}