diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-03-25 08:53:24 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-03-25 08:53:24 +0100 |
commit | ad79d74deef6e624aa7048543207ec97810f07f5 (patch) | |
tree | 9594965acecd7056ff37c17f2b53e6a04fe4a421 /test/files/neg | |
parent | 1187c9896c097e6e591e5655b35f52c06b3c900a (diff) | |
download | scala-ad79d74deef6e624aa7048543207ec97810f07f5.tar.gz scala-ad79d74deef6e624aa7048543207ec97810f07f5.tar.bz2 scala-ad79d74deef6e624aa7048543207ec97810f07f5.zip |
SI-7296 Avoid crash with nested 23-param case class
The implementation restriction doesn't stop subsequent
typechecking in the same compilation unit from triggering
type completion which tries to synthesize the unapply
method.
This commit predicates generation of the unapply method
on having 22 or fewer parameters.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t7296.check | 4 | ||||
-rw-r--r-- | test/files/neg/t7296.scala | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/t7296.check b/test/files/neg/t7296.check new file mode 100644 index 0000000000..66e8353ee3 --- /dev/null +++ b/test/files/neg/t7296.check @@ -0,0 +1,4 @@ +t7296.scala:5: error: Implementation restriction: case classes cannot have more than 22 parameters. + case class Foo(a: A, b: A, c: A, d: A, e: A, f: A, g: A, h: A, i: A, j: A, k: A, l: A, m: A, n: A, o: A, p: A, q: A, r: A, s: A, t: A, u: A, v: A, w: A, x: A, y: A, Z: A) + ^ +one error found diff --git a/test/files/neg/t7296.scala b/test/files/neg/t7296.scala new file mode 100644 index 0000000000..0c078d3657 --- /dev/null +++ b/test/files/neg/t7296.scala @@ -0,0 +1,6 @@ +object Test { + type A = Int + // Emits the implementation restriction but then proceeds to crash + // when creating the Foo.unapply. + case class Foo(a: A, b: A, c: A, d: A, e: A, f: A, g: A, h: A, i: A, j: A, k: A, l: A, m: A, n: A, o: A, p: A, q: A, r: A, s: A, t: A, u: A, v: A, w: A, x: A, y: A, Z: A) +} |