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 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
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 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index e966cc9060..1f54671ad0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -1373,7 +1373,9 @@ trait Namers extends MethodSynthesis { if (!cdef.symbol.hasAbstractFlag) namer.enterSyntheticSym(caseModuleApplyMeth(cdef)) - namer.enterSyntheticSym(caseModuleUnapplyMeth(cdef)) + val primaryConstructorArity = treeInfo.firstConstructorArgs(cdef.impl.body).size + if (primaryConstructorArity <= MaxTupleArity) + namer.enterSyntheticSym(caseModuleUnapplyMeth(cdef)) } def addCopyMethod(cdef: ClassDef, namer: Namer) { |