SI-6306 Remove incorrect eta-expansion optimization in Uncurry

Fix SI-6306 by removing the offending code. Moreover, clarify comment
and add testcase.

This pattern match only matches on testcases triggering SI-6306; the
transformation it performs in that case is unsafe.

The intended optimization is to undo eta-expansion of nullary functions,
that is, transform `() => foo()` to `foo`. But that's only valid when
`foo` is an instance of `Function0`, so the optimization is unsafe.
Moreover, the pattern match will fail because at the end of typer that
code has become `() => foo.apply()`, and `isExprSafeToInline(foo.apply)`
always (correctly) fails the isExprSafeToInline test. The pattern match
should thus be different - this code was dead even when it was
introduced (45bcd02f6ba099277bedbf83ec2bda07435c7797), since it was not
invoked either when building the compiler or when compiling function
attempt2() in the included testcase.

Thanks to all commenters on SI-6306 and
https://github.com/scala/scala/pull/1255, in particular to Jason Zaugg
for diagnosing the underlying fault and Lukas Rytz for understanding the
goal of the code.
Fix for SI-6367, exponential time in inference.

This pathology is not new - it can be witnessed in 2.9,
where compiling the test case enclosed with this ticket with
-Yinfer-debug will print a line with (pinky to lips) one million
type parameters. 1048576 actually, aka 2^20. But in 2.9 we were
somehow getting away with creating the list, presumably by not
spending much time looking at it. Somewhere between there and M1,
that changed.

I cut it off at the knees - don't create a list of one million
upper bound constraints when 1 will suffice. It would not be too
surprising if this proves to be a boon for performance.
Merge pull request #1255 from Blaisorblade/issue/6306

Fix SI-6306 on testcase
Test case for a bug fixed in M7.
Pending test for SI-3943
Rescued TreeBuilder from the parser.

For too long, Tree Builder has ruled over those who would
like to build their own trees.  Today marks the start of a
new era.  Trees are for building, not for parsers to hoard.
It's in Global now.

The particular motivation is exposing makeNew, and I also
added makeAnonymousNew, so rather than this...

Apply(Select(
  Block(List(ClassDef(
    Modifiers(scala.tools.nsc.symtab.Flags.FINAL), tpnme.ANON_CLASS_NAME, Nil,
    Template(List(Ident(definitions.AnyRefClass)), emptyValDef, List(
      DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(Nil), TypeTree(), Block(
        List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), Nil)),
        Literal(Constant(()))
      )))))),
  Apply(Select(New(Ident(tpnme.ANON_CLASS_NAME)), nme.CONSTRUCTOR), Nil))
, sn.GetClass), Nil)

We can write this.

  Apply(Select(makeAnonymousNew(Nil), nme.getClass_), Nil)
Better error message for pattern arity errors.

Because friends don't tell friends:

  "wrong number of arguments for <none>"
Merge pull request #1296 from paulp/210-errors-and-trees

210 errors and trees
Merge pull request #1294 from paulp/issue/6367

Fix for SI-6367, exponential time in inference.
Fixes SI-6259.  Unable to use typeOf in super call of top-level object.

This works around the issue of the inability to use classOf for top-level object classes by inventing a new
anonymous class and instantiating it just to grab its class.  Since the class is a nested type of the
top-level object it'll be in the same classloader unless some kind of evil behavior is afoot.

This patch should be undone if ever SI-2453 ever gets fixed, or we wind up with a direct way to grab
the class of an object.