SI-6956 determine switchability by type, not tree

Constant folding will set the type of a constant tree
to `ConstantType(Constant(folded))`, while the tree
itself can be many different things (in casu, an Ident).

We used to look at the tree directly when deciding whether
to emit a switch. Now we look at the tree's type. Voilà.
use Constant::isIntRange even if it's NIH
Closes SI-6952: add correct error positions for Dynamic feature check.
SI-6979 Small optimization in lub

If a member of `lubBase` is final, it cannot be
refined in the types we're lubbing.
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
Merge branch '2.10.x'

Conflicts:
	src/compiler/scala/tools/nsc/doc/Settings.scala
	src/compiler/scala/tools/nsc/interpreter/CompletionOutput.scala
	src/compiler/scala/tools/nsc/matching/Patterns.scala
	src/compiler/scala/tools/nsc/transform/UnCurry.scala
	src/compiler/scala/tools/nsc/typechecker/Infer.scala
	src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
	src/compiler/scala/tools/nsc/typechecker/Typers.scala
	src/reflect/scala/reflect/internal/settings/MutableSettings.scala
	src/reflect/scala/reflect/runtime/Settings.scala
	src/swing/scala/swing/SwingActor.scala
	src/swing/scala/swing/SwingWorker.scala
	test/files/run/t6955.scala
align partest script with ant

don't silently pass -deprecation to scalac by default
SI-6601 Publicise derived value contstructor after pickler

Otherwise the access restrictions are not enforced under
separate compilation.

See also SI-6608.
Merge pull request #1899 from paulp/pr/extract-scaladoc

Granted scaladoc its own Global.
Merge pull request #1905 from adriaanm/ticket-6956

SI-6956 determine switchability by type, not tree
Merge commit 'refs/pull/1906/head' into wip/pr-1906

* commit 'refs/pull/1906/head': (24 commits)
  SI-6675 Test new warning under -Xoldpatmat.
  SI-6675 -Xlint arity enforcement for extractors
  SI-6905 - Switch to sneakyThrows instead of Unsafe.throwException as per new jsr166y to avoid issues with Android
  SI-6963 Deprecates -Xmigration switch
  SI-5954 Implementation restriction preventing companions in package objs
  SI-6479 Don't lift try exprs in label arguments.
  SI-6082 Conditionally expand @ann(x) to @ann(value = x)
  SI-6126 Test case for varargs of tagged primitives.
  SI-5440 Test case for exhaustiveness check
  SI-5340 Change println to log
  SI-6955 switch emission no longer foiled by type alias
  clean up synthesizePartialFunction
  rework partial function synthesis
  SI-6925 use concrete type in applyOrElse's match's selector
  SI-5189 detect unsoundness when inferring type of match
  SI-6946, SI-6924 Greatly improves IsTraversableLike docs
  SI-6555 Scaladoc's class filter shouldn't drop the last character
  Backport of SI-6846.
  Fixes SI-6521, overrides Range#head to be faster
  SI-6641 Deprecate SwingWorker
  ...

Conflicts:
	src/compiler/scala/tools/nsc/typechecker/Typers.scala
Merge pull request #1854 from pufuwozu/ticket-SI-6923

SI-6923 Context now buffers warnings as well as errors
Merge pull request #1914 from retronym/ticket/6601

SI-6601 Publicise derived value contstructor after pickler
Merge pull request #1919 from paulp/pr/fix-merge-210

Re-merge of #1906