summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t8764.check5
-rw-r--r--test/files/run/t8764.flags1
-rw-r--r--test/files/run/t8764.scala16
3 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/t8764.check b/test/files/run/t8764.check
new file mode 100644
index 0000000000..6260069602
--- /dev/null
+++ b/test/files/run/t8764.check
@@ -0,0 +1,5 @@
+IntOnly: should return an unboxed int
+Int: int
+IntAndDouble: should just box and return Anyval
+Double: class java.lang.Double
+Int: class java.lang.Integer
diff --git a/test/files/run/t8764.flags b/test/files/run/t8764.flags
new file mode 100644
index 0000000000..48fd867160
--- /dev/null
+++ b/test/files/run/t8764.flags
@@ -0,0 +1 @@
+-Xexperimental
diff --git a/test/files/run/t8764.scala b/test/files/run/t8764.scala
new file mode 100644
index 0000000000..decc658f6e
--- /dev/null
+++ b/test/files/run/t8764.scala
@@ -0,0 +1,16 @@
+object Test extends App {
+case class IntOnly(i: Int, j: Int)
+
+println("IntOnly: should return an unboxed int")
+val a = IntOnly(1, 2)
+val i: Int = a.productElement(0)
+println(s"Int: ${a.productElement(0).getClass}")
+
+case class IntAndDouble(i: Int, d: Double)
+
+println("IntAndDouble: should just box and return Anyval")
+val b = IntAndDouble(1, 2.0)
+val j: AnyVal = b.productElement(0)
+println(s"Double: ${b.productElement(1).getClass}")
+println(s"Int: ${b.productElement(0).getClass}")
+}