SI-5568 Fixes verify error from getClass on refinement of value type

().asInstanceOf[AnyRef with Unit].getClass and
5.asInstanceOf[AnyRef with Int].getClass would cause a verify
error. Going the other way, i.e. [Unit with AnyRef] or [Int with AnyRef]
worked fine. This commit fixes it that both directions work out to
BoxedUnit or java.lang.Integer.
SI-5568 Comment improvements for getClass on primitive intersection.

Based on code review here are a few comment cleanups and the removal of
some dead test code.
Closes SI-6952: add correct error positions for Dynamic feature check.
SI-6017 Scaladoc's Index should be case-sensitive
SI-6443 Widen dependent param types in uncurry

Bridge building operates on unusual method signatures:
after uncurry, so parameter lists are collapsed; but before
erasure, so dependently typed parameters are still around.

Original:

  def foo(a: T)(b: a.type, c: a.U): Unit

During computeBridges:

  (a: T, b: a.type, c: a.U)Unit

This signature no longer appears to override the corresponding
one in a superclass, because the types of `b` and `c` are dependent
on method parameters.

The root of the problem is uncurry, which leaves the trees in
a poor state. This commit changes uncurry to remedy this.

An example illustrates it best:

    // source
    def foo(a: A)(b: a.type): b.type = b

    // post uncurry before this patch.
    // not well typed code!
    def foo(a: A, b: a.type): a.type = {

    // post uncurry after this patch
    def foo(a: A, b: A): A = {
       val b$1 = b.asInstanceOf[a.type]
       b$1
    }
SI-6443 Expand test coverage with varargs, by-name.

These were already working, due to a serendipitous
ordering of transformations. The tests will keep
it this way.
SI-6976 Fix value class separate compilation crasher.

We can't guarantee that the owner of the value class
is initialized, and if it isn't, the search for the
companion module will turn up bubkis.

This is a localized fix, but I'd be suprised if there
weren't other places that suffered from the same problem.

Wouldn't it be nicer to have something like:

    // doesn't force info
    sym.raw.info
    sym.raw.companionModule

    // forces info
    sym.info
    sym.companionModule
Forgot to cherry-pick the .check file
There is no "letters" method in this branch
SI-4976 Scaladoc: Add a source link to package objects
SI-6942 more efficient unreachability analysis

Avoid blowing the stack/the analysis budget by more eagerly translating
the propositions that model matches to CNF.
First building a large proposition that represents the match,
and then converting to CNF tends to blow the stack.
Luckily, it's easy to convert to CNF as we go.

The optimization relies on `CNF(P1 /\ ... /\ PN) == CNF(P1) ++ CNF(...) ++ CNF(PN)`:

Normalizing a conjunction of propositions
    yields the same formula as
concatenating the normalized conjuncts.

CNF conversion is expensive for large propositions,
so we push it down into the conjunction and
then concatenate the resulting arrays of clauses (which is cheap).

(CNF converts a free-form proposition into an `Array[Set[Lit]]`, where:
 - the Array's elements are /\'ed together;
 - and the Set's elements are \/'ed;
 - a Lit is a possibly negated variable.)

NOTE:
 - removeVarEq may throw an AnalysisBudget.Exception
 - also reworked the interface used to build formula,
   so that we can more easily plug in SAT4J when the time comes
use ArrayBuffer instead of Array to build Formulae
Merge pull request #1904 from JamesIry/SI-5568_2.10.x

SI-5568 Fixes verify error from getClass on refinement of value type
SI-6902 Check unreachability under @unchecked

Only exhaustiveness checking should be disabled if the
scrutinee of a match as annotated as `: @unchecked`.
This was the pre-2.10.x behaviour.

This also fixes a variation of the closed ticket,
SI-6011. The exhaustiveness check is needed to
safely fallback from emitting a table switch if
duplicate cases are detected.
SI-6439 Avoid spurious REPL warnings about companionship

`val m` isn't a companion of `trait m`, check the pair of
eponymous symbols are a ((class|trait), object) pair before
emitting the warning.

In order to correctly check this one a type alias is involved,
`definedSymbols` must avoid normalizing through type aliases.
AFAICT this is an improvement to the other clients of that Map,
one such power mode progression is demonstrated at the end
of the test case.
Addressing warnings.

 - SI-6923 uncovered a few valid warnings, these have been
   addressed.
 - A pair of "catches all throwable" warnings appeared; one
   of the is spurious and the subject of SI-6994.
SI-6994 Avoid spurious promiscuous catch warning

It was being issued upon re-typechecking of a transformed
tree. Now we disable the warning post-typer.
Merge pull request #1915 from adriaanm/ticket-6942

SI-6942 more efficient CNF conversion in patmat analysis
SI-6666 Restrict hidden `this` access in self/super calls.

Detect when classes (user authored or compiler generated)
local to a self or super constructor argument would require
premature access to the in-construction instance.

The same restriction applies for classes and objects; for objects,
the premature access would result in a null via MODULE$ field.

A residual error has been lodged as SI-6997.

I'd like to remove calls to `Symbol#outerClass` (which relies on
the flaky flag INCONSTRUCTOR, see my comments in the JIRA issue
for more discussion) from `LambdaLift` and `ExplicitOuter`, and
instead use the stack of active self/super calls to know when to
skip an enclosing class. That will obviate that flag.
SI-6231 Report unsupported free var capture by a trait.

If a class nested in a trait captures a free variable from
the enclosing scope of the trait, the transformation to
add that variable to the `init` method of the trait
implementation class happens *after* the abstract trait
interface has been extracted. This would lead to a crash
when trying to find the corresponding interface method.

This commit detects this situation and reports an
implementation restriction. The enclosed test case
shows a workaround.

To lift this restriction, LambdaLifter should add the getters
and make sure they end up in the trait interface. Looks like
Martin tried this once:

    // LambdaLift.scala
    //
    // Disabled attempt to to add getters to freeParams
    // this does not work yet. Problem is that local symbols need local names
    // and references to local symbols need to be transformed into
    // method calls to setters.
    // def paramGetter(param: Symbol): Tree = {
    //   val getter = param.newGetter setFlag TRANS_FLAG resetFlag PARAMACCESSOR // mark because we have to add them to interface
    //   sym.info.decls.enter(getter)
    //   val rhs = Select(gen.mkAttributedThis(sym), param) setType param.tpe
    //   DefDef(getter, rhs) setPos tree.pos setType NoType
    // }
    // val newDefs = if (sym.isTrait) freeParams ::: (ps map paramGetter) else freeParams