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-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.)
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.
Rewrite TailCalls for performance and immutability.

While logging symbols created after typer, I discovered that
TailCalls was far and away the largest creator. It turns out
this was due to a bug where thousands of labels were eagerly
created during tail call analysis, even if the method weren't
tail recursive and no label would ever be required.

This commit shaves 10% off the total number of method symbol
creations (compiling quick.lib drops from 88K to 80K.)
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.
Merge pull request #2322 from retronym/ticket/7200

SI-7200 Test case for fixed type inference error.
-Yshow-member-pos, print the positions of members.

Here for instance is a command line which leverages the
output of this option to print the method bodies of all
methods called 'transformInfo' found under src. Given
1500 source files it accomplishes this in four seconds,
thanks to -Ystop-after:parser.

% scalac -Yshow-member-pos sed -Ystop-after:parser \
    $(find src/compiler -name '*.scala') | \
    grep transformInfo | sed 's/ # .*//;' | \
    while read line; do echo "// $line" && gsed -n $line && echo; done

Or more simply, the start/end lines of each member of Random:

% scalac -Yshow-member-pos "" ./src/library/scala/util/Random.scala
./src/library/scala/util/Random.scala
20,134               class Random
 33                  def nextBoolean
 38                  def nextBytes
 43                  def nextDouble
 48                  def nextFloat
 54                  def nextGaussian
 59                  def nextInt
 65                  def nextInt
 70                  def nextLong
 81,89               def nextString
  82,86              def safeChar
   83                val surrogateStart
   84                val res
 94,98               def nextPrintableChar
 [snip]

It makes me sad I'm always in the position of having to hack
the compiler to do this sort of thing. All we need is something
like -Yinsert-phase:Foo where Foo is a class implementing a
(Phase, Tree) => Tree method, and the compiler runs all the
unit.bodies through it after each phase, and then one could
easily accomplish this in the privacy of one's own compiler.
SI-6675 Avoid spurious warning about pattern bind arity.

In 692372ce, we added a warning (under -Xlint) when binding
a `TupleN` in to a single pattern binder, which wasn't allowed
before 2.10.0, and more often than not represents a bug.

However, that warning overstretched, and warned even when
using a Tuple Pattern to bind to the elements of such a value.

This commit checks for this case, and avoids the spurious warnings.

A new test case is added for this case to go with the existing
test for SI-6675:

    $ ./tools/partest-ack 6675
    % tests-with-matching-paths      ...  3
    % tests-with-matching-code       ...  2
    # 3 tests to run.
    test/partest --show-diff --show-log                  \
      test/files/neg/t6675-old-patmat.scala              \
      test/files/neg/t6675.scala                         \
      test/files/pos/t6675.scala                         \
      ""

    Testing individual files
    testing: [...]/files/pos/t6675.scala                                  [  OK  ]

    Testing individual files
    testing: [...]/files/neg/t6675-old-patmat.scala                       [  OK  ]
    testing: [...]/files/neg/t6675.scala                                  [  OK  ]
    All of 3 tests were successful (elapsed time: 00:00:03)
Merge pull request #2410 from paulp/pr/parameterized-implicit

Quiet down overloaded implicit warning.
Merge pull request #2358 from adriaanm/ticket-7330

SI-7330 better error when pattern's not a value
Merge pull request #2387 from vigdorchik/interactive_scaladoc

Interactive scaladoc: demand new typer run when done.
SI-4365 nondeterministic failure in asSeenFrom

Under some order-dependent conditions (if source files arrive
in one order it happens, in the other order it does not) more
than one set of type parameters are created for a given class.
Previously this would lead to a crash in asSeenFrom when a type
parameter had to be matched up with a type application.

Now when that situation arises I compare them by name and log
a dev warning if it hits. This does not risk anything undesirable
happening because the wayward type parameter's owner is always
the right class; it's only the class type parameters which don't
include the wayward one. Since in a given type parameter list
names are unique, we have enough information to salvage the
search.
Warn on selection of vals from DelayedInit subclasses.

Which are likely to yield null, if the program didn't start.

This is a common source of confusion for people new to
the language, as was seen during the Coursera course.

The test case shows that the usage pattern within Specs2
won't generate these warnings.
SI-7355 Handle spaces in paths in Windows batch files.

Changed "%1%" and %2% to "%~1" and %~2 to allow spaces
in paths by surrounding quotes according to advice at:

  http://stackoverflow.com/questions/473117/pass-path-with-spaces-as-parameter-to-bat-file
  http://ss64.com/nt/syntax-args.html
Merge pull request #2435 from retronym/ticket/7355

SI-7355 Handle spaces in paths in Windows batch files.
Merge pull request #2420 from retronym/ticket/6675-2

SI-6675 Avoid spurious warning about pattern bind arity.
SI-7369 Avoid spurious unreachable warnings in patterns

Unreachability analysis draws on the enumerated domain of types
(e.g sealed subclasses + null, or true/false), and also looks at all
stable identifier patterns tested for equality against the same 'slot'
in a pattern.

It was drawing the wrong conclusions about stable identifier patterns.
Unlike the domain constants, two such values may hold the same value,
so we can't assume that matching X precludes matching Y in the same
slot in a subsequent case.

For example:

    val X: Boolean = true; val Y: Boolean = true
    def m1(t1: Tuple1[Boolean]) = t1 match {
      case Tuple1(true) =>
      case Tuple1(false) =>
      case Tuple1(false) => // correctly unreachable
    }
    def m2(t1: Tuple1[Boolean]) = t1 match {
      case Tuple1(X) =>
      case Tuple1(Y) => // spurious unreachable warning
    }

    //
    // Before
    //
    reachability, vars:
    V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1
    V1: (Boolean,) ::= null | ... // = x1
    equality axioms:
      V2=true#4  \/ V2=false#5  /\
     -V2=false#5 \/  -V2=Y#3    /\
     -V2=false#5 \/  -V2=X#2    /\
     -V2=false#5 \/ -V2=true#4  /\
       -V2=Y#3   \/  -V2=X#2    /\
       -V2=Y#3   \/ -V2=true#4  /\
       -V2=X#2   \/ -V2=true#4

    //
    // After
    //
    reachability, vars:
    V2: Boolean ::= true | false// Set(false, Y, X, true) // = x1._1
    V1: (Boolean,) ::= null | ... // = x1
    equality axioms:
      V2=true#4  \/ V2=false#5  /\
     -V2=false#5 \/ -V2=true#4
Updated jline and rebuilt.

Two years of atrophy. Now using sbt 0.12.3 and latest
versions of jansi, etc.
SI-7367 scaladoc crash on constructing the model for annotations.

Scaladoc only checks primary constructor when building annotation
model.

Here we instead find the constructor matching the annotation's symbol.
Also change TreeFactory.makeTree to return TreeEntity rather than
Option[TreeEntity] and force the caller check for EmptyTree.
for null outer pointer, NPE via throw null

As per the JVM spec, the athrow instruction throws a NullPointerException upon finding null on stack top.
This commit takes advantage of that feature, to emit more compact code.

The constructor of an inner class that receives an outer value first checks that value for nullness, depending on which NPE may be thrown.
The code now emitted to achieve the above looks like:

    0: aload_1
    1: ifnonnull     6
    4: aconst_null
    5: athrow
    6: ...