Merge pull request #1862 from retronym/ticket/6641-2.11.x

SI-6641 Cull scala.swing.SwingWorker
Merge pull request #1856 from retronym/topic/sbt-git-move

sbt-git-plugin has moved.
Merge commit 'refs/pull/1844/head' into merge/pr-1844

* commit 'refs/pull/1844/head':
  macroExpandAll is now triggered by typed
  SI-5923 adapt macros when they are deferred
  generalizes macroExpand
  typedPrimaryConstrBody now returns supercall
  more precise errors for macros
  parentTypes => typedParentTypes
  changes isTermMacro checks to something more universal
  fixes printing of AppliedTypeTree
  adds Trees.replace(Tree, Tree)
  makes macro override error more consistent
  refactors handling of macros in repl
  SI-5903 extractor macros do work
  adds c.macroRole

Conflicts:
	src/compiler/scala/tools/nsc/typechecker/Macros.scala
	src/compiler/scala/tools/nsc/typechecker/Typers.scala
Merge pull request #1885 from paulp/merge/pr-1844

Resolving new merge conflicts between #1844 and master.
Merge pull request #1863 from retronym/ticket/6641-2.10.x

SI-6641 Deprecate SwingWorker
Merge pull request #1853 from paulp/issue/6928

SI-6928, VerifyError with self reference to super.
Merge pull request #1869 from retronym/backport/1826

Backport of SI-6846.
SI-6964 Remove build managers, both simple and refined.

Deprecated in 2.10.0, out to pasture in 2.11.0.

Users are advised to migrate to:

   https://github.com/typesafehub/zinc
   http://www.scala-sbt.org/
SI-6966 Fix regression in implicit resolution

Reverts this line: 9c09c17#L50L671. That value was
apparantly discarded intentionally.
Merge pull request #1859 from retronym/ticket/6912

SI-6912 Avoid a typer cycle in overload resolution.
SI-5340 Change println to log

An esoteric implicit search could trigger an "amb prefix ..."
message to standard out. Now the message has been improved
and sent to the logger.
SI-5440 Test case for exhaustiveness check

Reported against patmatclassic, working in virtpatmat.
SI-6126 Test case for varargs of tagged primitives.

This started working after the merge fe1110f. I didn't track
down precisely which commit was responsible beyond that.
SI-6082 Conditionally expand @ann(x) to @ann(value = x)

... if the annotation has an argument with the name `value`.

Doing so unconditionally obscures error messages.

We still require that arguments to ClassFileAnnotations
are named, other than for this special case.
SI-6479 Don't lift try exprs in label arguments.

The new pattern matcher uses label jumps to GOTO
the next case. Uncurry treated these like regular
method arguments, and performed the liftedTree()
transformation, which ensures that try expressions
are only used in a statement position. Even try
in statement position of a block used as such an argument
are subject to the same transform.

This transform stems from the JVM limitation,
that try/catch does not leave a value on the stack.
See b194446.

This commit changes Uncurry to avoid this transform
for arguments to label jumps. This avoids needlessly
indirect code, and enables tail call elimination in
more cases.

As an example, Scala 2.10.0 transforms the last
method of the enclosed test case to:

      try {
        case <synthetic> val x1: Int = 1;
        case5(){
          if (2.==(x1))
            {
              val x2: Int = x1;
              matchEnd4({
                {
                  def liftedTree2(): Unit = try {
                    throw new scala.runtime.NonLocalReturnControl[Unit](nonLocalReturnKey1, ())
                  } catch {
                    case (e @ (_: ClassNotFoundException)) => ()
                  };
                  liftedTree2()
                };
                TailrecAfterTryCatch.this.bad()
              })
            }
          else
            case6()
        };
        case6(){
          matchEnd4(throw new MatchError(x1))
        };
        matchEnd4(x: Unit){
          x
        }
      } catch {
        case (ex @ (_: scala.runtime.NonLocalReturnControl[Unit @unchecked])) => if (ex.key().eq(nonLocalReturnKey1))
          ex.value()
        else
          throw ex
      }

After this patch:

    @scala.annotation.tailrec final def bad(): Unit = {
      case <synthetic> val x1: Int = 1;
      case5(){
        if (2.==(x1))
          {
            <synthetic> val x2: Int = x1;
            matchEnd4({
              try {
                return ()
              } catch {
                case (e @ (_: ClassNotFoundException)) => ()
              };
              TailrecAfterTryCatch.this.bad()
            })
          }
        else
          case6()
      };
      case6(){
        matchEnd4(throw new MatchError(x1))
      };
      matchEnd4(x: Unit){
        x
      }
    }
SI-5954 Implementation restriction preventing companions in package objs

Companion objects (and thus also case classes) in package objects caused
an assert about an overloaded symbol when everything was compiled twice.
It's a hairy problem that doesn't fit in 2.10.1. So this fix adds an
implementation restriction. It also has a test to make sure the error
messages are clean and reasonably friendly, and does not catch other
things defined in package objects. The test includes a
commented out test in case somebody thinks they've solved the underlying
problem.

A handful of tests were falling afoul of the new implementation
restriction. I verified that they do in fact fail on second compile so
they aren't false casualties. But they do test real things we'd like
to work once the re-compile issue is fixed. So I added a -X flag to
disable the implementation restriction and made all the tests
accidentally clobbered by the restriction use that flag.
SI-6963 Deprecates -Xmigration switch

-Xmigration is specific to the 2.7 to 2.8 upgrade and is no longer
relevant. There is no plan to maintain it so it will be removed. This
commit deprecates it in anticipation.
Remove EqualsPatternClass.

Detritus from the classic pattern matcher, which was recently
removed 6084d2d9.
SI-6905 - Switch to sneakyThrows instead of Unsafe.throwException as per new jsr166y to avoid issues with Android
Merge pull request #1896 from retronym/topic/remove-equals-pattern-class

Remove EqualsPatternClass.