title: How does one compile scala with bigger tuples?
body: <p>I want to compile Scala distribution with bigger limit for number of tuple arguments - for example, 50 instead of 22. (and function/case class/etc limits upped as well)</p>
  
  <p>I assumed that those TupleN, FunctionN and the like are generated at compile-time. But in sources directory, I found all those Tuple1 to Tuple22, with comment that they are generated.</p>
  
  <p>Also, I found src/build/genprod.scala file, which seems to be the needed file. But what is the right way to run it?</p>
  
  <p>I changed <code>MAX_ARITY</code> in <code>genprod</code> and changed <code>MaxFunctionArity</code> in <code>Definitions.scala</code>, what else I need to change to make it work?</p>
  
  <p>And is it possible to use the resulting scala distribution with sbt? Or are there some fundamental problems with that?</p>
  
  <p><strong>NOTE:</strong> I completely understand that it is not very good to try to work around tuple problems this way, but in this case it's more of an educational project.</p>
  
  <p><strong>EDIT:</strong> Well, it gets interesting. Since scala compiler is bootstraped, I can't compile it with bigger tuples, since old compiler enforces 22 limit. So it seems that first I need to create a compiler with that limit increased, and only after that compile in more tuples. How can I do it?</p>
  
  <p><strong>EDIT2:</strong> Now I have a problem - I tried to increase MaxFunctionArity and run <code>ant replacestarr-opt</code>, but then it fails with <code>scala.Function23 not found</code>. If I try adding scala.Function23 and the like, it fails to compile at all. Is there a way to fix it?</p>
  
  <p><strong>EDIT3:</strong> I tried to execute the commands in the following order:</p>
  
  <pre><code>ant build
  # increase MaxFunctionArity
  ant build
  ant replacelocker
  # generate TupleN classes
  ant build
  
  # this fails
  ant replacelocker
  </code></pre>
  
  <p>The <code>ant replacelocker</code> seems to fail because <code>starr</code> compiler is used, and it still does not allow more than 22 arguments.</p>
  
  <p>I tried to replace starr:</p>
  
  <pre><code>ant build
  # increase MaxFunctionArity
  ant build
  ant replacelocker
  ant replacestarr # failed
  </code></pre>
  
  <p>but this failed with <code>scala.Function23 not found</code>. Seems to be a deadlock - I need to change that <code>MaxFunctionArity</code> <em>and</em> generate classes, but I can't do that simultaneously, and if I try to separate those actions I get a failure.</p>
  
  <p>Is there some way to resolve that?</p>
  
  <p><strong>EDIT4:</strong> I forgot to mention that in this experiment I'm torturing Scala 2.9.2, as it is the last stable version.</p>
  
  <p><strong>EDIT5:</strong> Since I actually managed to build <code>quick</code> compiler with big tuples using <code>locker</code> compiler, I expected that there was some problem with <code>starr</code> layer.</p>
  
  <p>So I tried to do the following (without altering anything):</p>
  
  <pre><code>ant build
  ant replacelocker
  ant replacestarr
  </code></pre>
  
  <p>And the last command failed with</p>
  
  <pre><code>Unable to find jar:file:/home/platon/Input/sources/scala-tupled/lib/scala-compiler.jar!/scala/tools/ant/sabbus/antlib.xml
  </code></pre>
  
  <p>Now that's strange, why it can't build itself?</p>