aboutsummaryrefslogtreecommitdiff
path: root/tests/run/1938.scala
diff options
context:
space:
mode:
authorOlivier Blanvillain <olivier.blanvillain@gmail.com>2017-04-06 18:44:21 +0200
committerOlivier Blanvillain <olivier.blanvillain@gmail.com>2017-04-06 18:54:08 +0200
commit5bf9d2b0046b60ae9fcdc218cd190e17023b4fae (patch)
tree842c4e3df808217ddebea02199a667c7de94e44b /tests/run/1938.scala
parent944e677f437c39d85280c388cab000b5490e4386 (diff)
downloaddotty-5bf9d2b0046b60ae9fcdc218cd190e17023b4fae.tar.gz
dotty-5bf9d2b0046b60ae9fcdc218cd190e17023b4fae.tar.bz2
dotty-5bf9d2b0046b60ae9fcdc218cd190e17023b4fae.zip
Add tests
- t7296 & case-class-23 are moved out of pending - 1938 tests productElement > 23
Diffstat (limited to 'tests/run/1938.scala')
-rw-r--r--tests/run/1938.scala45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/run/1938.scala b/tests/run/1938.scala
new file mode 100644
index 000000000..95e94678d
--- /dev/null
+++ b/tests/run/1938.scala
@@ -0,0 +1,45 @@
+case class Large(
+ e1: Int,
+ e2: Int,
+ e3: Int,
+ e4: Int,
+ e5: Int,
+ e6: Int,
+ e7: Int,
+ e8: Int,
+ e9: Int,
+ e10: Int,
+ e11: Int,
+ e12: Int,
+ e13: Int,
+ e14: Int,
+ e15: Int,
+ e16: Int,
+ e17: Int,
+ e18: Int,
+ e19: Int,
+ e20: Int,
+ e21: Int,
+ e22: Int,
+ e23: Int
+)
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val l = Large(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)
+
+ assert(l.productArity == 23)
+
+ assert(l.productElement(0) == 1)
+ assert(l.productElement(1) == 2)
+ assert(l.productElement(21) == 22)
+ assert(l.productElement(22) == 23)
+
+ try {
+ l.productElement(23)
+ ???
+ } catch {
+ case e: IndexOutOfBoundsException => assert(e.getMessage == "23")
+ }
+ }
+}