SI-6725 `f` interpolator now supports %n tokens

Currently the `f` interpolator supports format specifiers which
specify conversions for formatted arguments. However Java formatting
is not limited to argument-related conversions as explained in:
http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#detail.

Conversions which don't correspond to any arguments are `%` (used to
emit verbatim `'%'` characters) and `n` (used to emit platform-specific
line separators). Of those only the former is supported, and this patch
fixes the oversight.
SI-7132 - don't discard Unit type in interpreter
SI-7233 Account for aliased imports in eta expansion.

Buggy:

    treeCopy.Select(sel, sel.qual, sel.name) setSymbol null
    Select(sel, sel.qual, sel.name)

Okay:

    treeCopy.Select(sel, sel.qual, sel.name)
    Select(sel, sel.qual, sel.symbol.name) // but doesn't copyAttrs!

It is an easy mistake to make, I've found one more occurance:

  def foo(a: Any) = { import a.{toString => toS}; toS }

    error: uncaught exception during compilation: scala.reflect.internal.FatalError
    scala.reflect.internal.FatalError: class Object does not have a member toS
        at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1028)

A followup commit will address that problem.
SI-7233 Account for aliased imports in Erasure

When we discard the fiction of `scala.Any`.
SI-7240 fixes language feature lookup

As I discovered today, Definitions.getMember have a fallback clause,
which accounts for the phases which have inner classes flattened.

This fallback uses nme.flattenedName to compute a flattened name, but
unfortunately nme.flattenedName produces a TermName, not a TypeName,
which means that the fallback will commence search in a wrong namespace
with predictable results.

The commit also changes another usage of nme.flattenedName in a type name
context. That one was correctly converting a TermName result to TypeName,
so this is not a bugfix, but just a refactoring for the sake of being
consistent.
Merge pull request #2227 from mergeconflict/2.10.x-SI-7132

SI-7132 - don't discard Unit type in interpreter
Merge pull request #2222 from scalamacros/ticket/6725

SI-6725 `f` interpolator now supports %n tokens
Merge pull request #2230 from retronym/ticket/7233

SI-7233 Account for aliased imports in EtaExpansion / Erasure
Merge pull request #2234 from scalamacros/ticket/7240

SI-7240 fixes language feature lookup
SI-7251, compiler crash with $.

We don't need to assert our way out of tight spots, we can issue
an error. Or so I once thought.

It turns out lots of assertions have been disappearing before
being heard thanks to "case t: Throwable". Under such conditions,
a failed assertion is a no-op, but an error is an error.

The crash associated with SI-7251 is best avoided by removing the
assertion, which allows an error to be issued in the normal course
of events.

In the course of trying to figure out the above, I cleaned up
ClassfileParser somewhat.
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.
SI-7296 Remove arity limit for case classes

When venturing above the pre-ordained limit of twenty
two, `Companion extends FunctionN` and `Companion.unapply`
are sacrificed. But oh-so-many other case class features
work perfectly: equality/hashing/stringification, the apply
method, and even pattern matching (which already bypasses
unapply.)

There was some understandable fear of the piecemeal when
I tabled this idea on scala-internals [1]. But I'd like
to persist as this limit is a needless source of pain for
anyone using case classes to bind to database, XML or JSON
schemata.

[1] https://groups.google.com/forum/#!topic/scala-internals/RRu5bppi16Y
Improve testing interactive experience.

Currently the exceptions that happen in the test are swallowed, as
the JVM is forced to exit before printing the stack trace.
Also assert message doesn't contain information about the problem.

The call to "sys.exit" masks bugs in the testing framework, that
has to be addressed more elaborately, so here we remove it. Also
add the message parameter to assert to make it more informative.

After removing "sys.exit" call, doc test starts failing. I suspect
there might be a problem when expanding doc variables, but this
should be addressed separately.
Iterator.++ no longer blows the stack.

To my chagrin we still hadn't gotten this one. I took a new
approach which seems like a winner to me. Here's a benchmark:

object Test {
  def run(n: Int) = println((1 to n).foldLeft(Iterator.empty: Iterator[Int])((res, _) => res ++ Iterator(1)) sum)
  def main(args: Array[String]): Unit = run(args(0).toInt)
}

Runtime before this commit for various n:

  500   0.403 real
  1000  0.911 real
  1500  2.351 real
  2000  5.298 real
  2500 10.184 real

Runtime after this commit, same n:

  500  0.346 real
  1000 0.359 real
  1500 0.368 real
  2000 0.379 real
  2500 0.390 real

In the test case I dial it up to 100000.
SI-7302 importing from Any.

Turns out the "minor tweaks" in 632daed4ed were only minor
for major values of minor. You can indeed import members from
Any/Object, so long as you rename them. Reverted logic error.
Test case will accompany SI-7233 upon merge into master.
Merge pull request #2323 from paulp/pr/iterator_++

Iterator.++ no longer blows the stack.
Merge commit 'refs/pull/2326/head' into pr/merge-395e90a786
Merge commit '395e90a786' into pr/merge-395e90a786

* commit '395e90a786':
  SI-7251, compiler crash with $.
  SI-7240 fixes language feature lookup
  SI-7233 Account for aliased imports in Erasure
  SI-7233 Account for aliased imports in eta expansion.
  SI-7132 - don't discard Unit type in interpreter
  SI-6725 `f` interpolator now supports %n tokens

Conflicts:
	src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
	src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala
	src/repl/scala/tools/nsc/interpreter/ExprTyper.scala
Merge pull request #2333 from paulp/pr/merge-395e90a786

Merge 2.10.x (through 395e90a786) into master.
Merge pull request #2316 from vigdorchik/interactive_test_framework

Improve testing interactive experience.