Skip to content

Commit 0fdeba2

Browse files
committed
vcArrays: tests for newArray invocation
1 parent aeb6323 commit 0fdeba2

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

test/dotc/tests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class tests extends CompilerTest {
111111
@Test def pos_vc_array_gen = compileFile(runDir, "valueclasses-array-gen", args = "-Ycheck:all" :: Nil)
112112
@Test def pos_vc_array_int = compileFile(runDir, "valueclasses-array-int", args = "-Ycheck:all" :: Nil)
113113
@Test def pos_vc_array_object = compileFile(runDir, "valueclasses-array-object", args = "-Ycheck:all" :: Nil)
114+
@Test def pos_vc_array_newarray = compileFile(runDir, "valueclasses-array-newarray", args = "-Ycheck:all" :: Nil)
114115

115116
@Test def pos_all = compileFiles(posDir) // twice omitted to make tests run faster
116117

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Set(X@0)
2+
Set(Y(null))
3+
Set(Z(null))
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class X(val x: Int) extends AnyVal
2+
class Y(val y: Object) extends AnyVal {
3+
override def toString = s"Y($y)"
4+
}
5+
class Z(val z: String) extends AnyVal {
6+
override def toString = s"Z($z)"
7+
}
8+
object Test {
9+
def main(args: Array[String]) = {
10+
println(a.toSet)
11+
println(b.toSet)
12+
println(c.toSet)
13+
}
14+
15+
def a = new Array[X](2)
16+
def b = new Array[Y](3)
17+
def c = new Array[Z](4)
18+
}

0 commit comments

Comments
 (0)