summaryrefslogtreecommitdiff
path: root/test/files/pos/starargs.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/starargs.scala')
-rw-r--r--test/files/pos/starargs.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/pos/starargs.scala b/test/files/pos/starargs.scala
new file mode 100644
index 0000000000..40b9124637
--- /dev/null
+++ b/test/files/pos/starargs.scala
@@ -0,0 +1,17 @@
+case class C[a](x: a*) {
+ def elems: Seq[a] = x;
+}
+
+object Test with Executable {
+ def foo(x: int*) = {
+ C(x: _*);
+ }
+ System.out.println(foo(1, 2, 3).elems);
+ System.out.println(foo(List(1, 2, 3): _*).elems);
+ System.out.println(new C(1, 2, 3).elems);
+ val xs = List(1, 2, 3);
+ System.out.println(new C(xs: _*).elems);
+}
+
+
+