summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-09-01 14:29:41 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-09-01 14:29:41 +0000
commit05676863c18d70e3b5c979ebe2f04000305e41cd (patch)
tree161a64bcf080632fd8e0e7261a3d94118f297f76 /test
parent1c4a348aa34ec08d4a75dad3536b656d4c93994e (diff)
downloadscala-05676863c18d70e3b5c979ebe2f04000305e41cd.tar.gz
scala-05676863c18d70e3b5c979ebe2f04000305e41cd.tar.bz2
scala-05676863c18d70e3b5c979ebe2f04000305e41cd.zip
Merged revisions 22466,22851 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r22466 | extempore | 2010-07-02 03:01:44 +0200 (Fri, 02 Jul 2010) | 2 lines Fail more gracefully on > 22 case class parameters. Closes #3631, no review. ........ r22851 | rytz | 2010-08-27 10:54:49 +0200 (Fri, 27 Aug 2010) | 10 lines partial fix for see #3772. remaining problem is when the explicit companion object is specified after the class: {{{ scala> def g { case class C(); object C; } <console>:5: error: C is already defined as (compiler-generated) case class companion object C def g { case class C(); object C; } ^ }}} review by odersky ........
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bug3631.check4
-rw-r--r--test/files/neg/bug3631.scala3
-rw-r--r--test/files/pos/caseClassInMethod.scala5
3 files changed, 12 insertions, 0 deletions
diff --git a/test/files/neg/bug3631.check b/test/files/neg/bug3631.check
new file mode 100644
index 0000000000..12d94aa4dc
--- /dev/null
+++ b/test/files/neg/bug3631.check
@@ -0,0 +1,4 @@
+bug3631.scala:3: error: Implementation restriction: case classes cannot have more than 22 parameters.
+case class X23(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int, x23: Int) { }
+ ^
+one error found
diff --git a/test/files/neg/bug3631.scala b/test/files/neg/bug3631.scala
new file mode 100644
index 0000000000..bcf91619ee
--- /dev/null
+++ b/test/files/neg/bug3631.scala
@@ -0,0 +1,3 @@
+case class X22(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) { }
+
+case class X23(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int, x23: Int) { } \ No newline at end of file
diff --git a/test/files/pos/caseClassInMethod.scala b/test/files/pos/caseClassInMethod.scala
new file mode 100644
index 0000000000..958e5dd473
--- /dev/null
+++ b/test/files/pos/caseClassInMethod.scala
@@ -0,0 +1,5 @@
+object t {
+ def f = { object C; case class C(); 1 }
+ // pending: def g = { case class D(x: Int); object D; 2 }
+ def h = { case class E(y: Int = 10); 3 }
+}