SI-7200 Test case for fixed type inference error.

Broken in 2.9.2 and 2.10.0, but working in 2.10.1

--- sandbox/2.10.0.log
+++ sandbox/2.10.1.log
       def coflatMap[A >: Nothing <: Any, B >: Nothing <: Any](f: Test.Nel[A] => B): Test.Nel[A] => Test.Nel[B] = ((l: Test.Nel[A]) => Test.this.Nel.apply[B](f.apply(l), l.tail match {
         case immutable.this.Nil => immutable.this.Nil
-        case (hd: A, tl: List[A])scala.collection.immutable.::[A]((h @ _), (t @ _)) => {
-          val r: Test.Nel[Nothing] = NelFoo.this.coflatMap[A, Nothing](f).apply(Test.this.Nel.apply[A](h, t));
+        case (hd: A, tl: List[A])scala.collection.immutable.::[?A1]((h @ _), (t @ _)) => {
+          val r: Test.Nel[B] = NelFoo.this.coflatMap[A, B](f).apply(Test.this.Nel.apply[A](h, t));
           {
-            <synthetic> val x$1: Nothing = r.head;
-            r.tail.::[Nothing](x$1)
+            <synthetic> val x$1: B = r.head;
+            r.tail.::[B](x$1)
           }
         }
       }))

b74c33eb86 represents the exact moment of progression. Comments
in pos/t7200b.scala, a minimal test that demonstrates the problem
without type constructors or code execution, pinpoint the line of
code responsible for the fix.

Incidentally, I'm currently on a train somewhere between Solothurn
and Biel, and am consequently without the power of scala-bisector.
Undeterred, and inspired by a line I saw in Skyfall last night
("sometimes the olds ways are better"), I just pulled off a two-hop
bisection. Take that, O(log N)!

The one remaining worry is the appearance of the type variable
?A1 in the output of -Xprint:typer for run/t7200.scala.
SI-7329 duplicate default getters for specialized parameters.

The default getter is generated with @specialized annotation if the
type parameter corresponding to the type of the parameter is
specialized. Consequently specialize pass tries to generate overloads.

Rather than pruning overloads to exclude duplicates, let's notice
that default getter specialization is not needed at all:
  - The dynamic scope of default getter doesn't include specialized
    method or class constructor.
  - generic default getter is called even when calling specialized
    method:
    object V {
      @specialized def foo[@specialized B](b: B = (??? : B)) = {}
      foo[Int]()
    }
    gives:
      invokevirtual Method V$.foo$default$1:()Ljava/lang/Object;
      invokestatic (unboxToInt)
      invokevirtual Method V$.foo$mIc$sp:(I)V
SI-7330 better error when pattern isn't a value

Somehow an applied type managed to sneak past the type checker in pattern mode.
Patterns must be values, though.

`case C[_] =>` was probably meant to be `case _: C[_] =>`
Advice is dispensed accordingly. (Generalizing the existing advice machinery.)
SI-6286 IllegalArgumentException handling specialized method.

Specialize assigns SpecialOverride info to a specialized method
even when there is a further specialization that should be forwarded
to.
SI-7360 Don't let a follow-up TypeError obscure the original error.

When supplementing a fatal error message with context (current
compilation unit, tree, phase, etcetera), we must be cautious to
not to trigger another error which will obscure the original one.

Currently, `supplementErrorMessage` does its working a try catch
that only catches `Exception`. But this fails to catch
CyclicReferenceError (<: TypeError <: Throwable), as was seen
in a recent mailing list post by Greg Meredith.

This commit extends the catch clause.
Merge pull request #2389 from retronym/ticket/7360

SI-7360 Don't let a follow-up TypeError obscure the original error.
Merge pull request #2383 from vigdorchik/ticket/si-6286

SI-6286 IllegalArgumentException handling specialized method.
SI-7319 Clear error buffer during Typer reset.

Contexts share error/warning buffers with their
children, and this also applies ot the shared
`startContext`.

That context flushes the buffers in `startContext`
in `resetContexts`.

It also removes `typerReportAnyContextErrors`, which
appears to be an elaborate no-op. It is only ever passed
a context `c` which is a direct child of `this.context`.
So taking a buffered error out of `c` and reissuing it
into `this.context` merely re-inserts into into the same
error buffer. Consrast this with `silent`, which uses
a child context with a fresh error buffer.

SI-7319 Flush error buffer in typerReportAnyContextErrors.

After this change, we no longer rely on the backstop in resetContexts
introduced in the previous commit.
SI-7377 Fix retypechecking of patterns on case companion alias

Some ancient code in Typers switches from PATTERNmode to
EXPRmode when encountering `stableF(...)`. It just
typechecks `stableF` and discards the arguments.

To the best of Martin's recollection, this has something
to do with the need to typecheck patterns rather late in
the compiler, after `a.b` had been translated to `a.b()`
in `Uncurry`. I'm not able to motivate this with tests
using `-Xoldpatmat`; was there ever an even older pattern
matcher that ran *after* uncurry?

What changed in 2.10.1 to expose this wrinkle? dfbaaa17
fixed `TypeTree.copyAttrs` to copy the original tree.
During the descent of `ResetAttrs`, sub-trees are duplicated
before begin further transformed. Duplicating the `Match`
in 2.10.0 would forget that the original tree of:

    pat = (a: Int)Foo(_)
          `----------`
               `- TypeTree((a: Int)Foo), with original Select(..., "FooAlias")

The retypechecking would operate on the `MethodType`, rather
than the `Select`, which was not considered a stable
application.

For 2.10.x, I've just tightened up the condition to only
hit this if `args` is empty. I'm almost certain that the code
can be removed altogether, and I'll do that when this is merged
to master.
Interactive scaladoc: mark new typer run when done.

As of now, when backgroundCompile is in the same typer run as
scaladoc-fetching logic, typer is confused with stale symbols.
Absolute path in error message.

As soon as you have a directory called "language" lying around,
you will appreciate why the advice given regarding SIP-18
should be "import scala.language..." not "import language..."
Quiet down overloaded implicit warning.

Apparently implicit classes product both a method symbol and
a module symbol, both of which are marked implicit, which left
this warning code believing there was an overloaded implicit
method.
SI-7388 Be more robust against cycles in error symbol creation.

`Symbol#toString` was triggering `CyclicReferenceError` (specifically,
`accurateKindString` which calls `owner.primaryConstructor`.)

The `toString` output is used when creating an error symbol to
assign to the tree after an error (in this case, a non-existent
access qualifier.)

This commit catches the error, and falls back to just using the
symbol's name.
Merge pull request #2364 from vigdorchik/ticket/si-7329

SI-7329 duplicate default getters for specialized parameters.
Merge pull request #2370 from retronym/ticket/7319-2

SI-7319 Avoid unflushed error/warning buffers in startContext
Merge pull request #2402 from retronym/ticket/7377

SI-7377 Fix retypechecking of patterns on case companion alias
Merge pull request #2411 from retronym/ticket/7388

SI-7388 Be more robust against cycles in error symbol creation.
Merge pull request #2408 from paulp/pr/fully-qualified-name

Absolute path in error message.
Merge pull request #2322 from retronym/ticket/7200

SI-7200 Test case for fixed type inference error.
Merge pull request #2410 from paulp/pr/parameterized-implicit

Quiet down overloaded implicit warning.