Merge 2.10.x into master

Conflicts:
	src/compiler/scala/reflect/reify/Errors.scala
	src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
Merge pull request #2240 from paulp/pr/warn-forward-reference

Warn about locally identifiable init order issues.
Merge pull request #2227 from mergeconflict/2.10.x-SI-7132

SI-7132 - don't discard Unit type in interpreter
Merge pull request #2222 from scalamacros/ticket/6725

SI-6725 `f` interpolator now supports %n tokens
Merge pull request #2230 from retronym/ticket/7233

SI-7233 Account for aliased imports in EtaExpansion / Erasure
Merge pull request #2234 from scalamacros/ticket/7240

SI-7240 fixes language feature lookup
Merge pull request #2236 from retronym/ticket/6601-2

SI-6601 Close access loophole for value class constructors
Optimize rebalance method by using null optimized list implementation.

rebalance method relies heavily on s.c.i.List. By replacing List with null
optimized version, NList, rebalance operation is significantly more faster.
Test indicate +10 % performance improvement for tree sizes >= 100.

Existing tests verify red-black tree invariants, including operations
involving tree rebalance.
SI-7242 Fix crash when inner object mixes in its companion

Given:

    class C {
      trait T { C.this }            // C$T$$$outer$ : C
      object T extends T { C.this } // C$T$$$outer$ : C.this.type
    }

object T ended up with a definitions for both of the accessors.
These cannot co-exist, as they have the same erased type. A crash
ensued almost immediately in explitouter.

Fortunately, the solution is straightforward: we can just omit
the mixin outer accessor altogether, the objects own outer accessor
is compatible with it.

    scala> :javap C.T
    Compiled from "<console>"
    public interface C$T{
        public abstract C C$T$$$outer();
    }

    scala> :javap C.T$
    Compiled from "<console>"
    public class C$T$ extends java.lang.Object implements C$T{
        public C C$T$$$outer();
        public C$T$(C);
    }

I also added an assertion to give a better error message in
case we find ourselves here again.

Also includes tests from SI-3994, which I'll mark as a duplicate.
Update sbt.latest.version to sbt's latest version.

And tweak deprecated stub so it compiles with 0.12.2.
Merge pull request #2246 from paulp/pr/sbt

Update sbt.latest.version to sbt's latest version.
Merge pull request #2242 from adriaanm/merge-2.10.x

Merge 2.10.x into master
Fix it-never-happened performance regression.

Diligent reviewer observed that a hot spot was possibly
being made hotter. Reviewer's suggested remedy was a
spectacular bust, but studious observation revealed the news
lash that expensive methods are expensive and we should
avoid calling them if we can.

Put short-circuit test back in front of unapply call.
Now the time spent in unapply is within a few percent.
SI-7236 Deprecate ThreadPoolTaskSupport and friends
Merge pull request #2215 from paulp/issue/7228

SI-7228, bug in subtyping.
SI-6921 SI-7239 Tread lightly during exploratory typing

When deciding whether an Assign is a named argument or
and assignment expression, or when looking at arguments
that the current selection is applied to in order to
evaluate candidate implicit views, we risk polluting
the tree by setting error types. This happens even
if we are in 'silent' mode; that mode does silence the
error report, but not the side effect on the tree.

This commit adds strategic `duplicate` calls to
address the problem symptomatically.

Duplicating trees and retyping in general reach into
the domain of bugs umbrella-ed under SI-5464, but in
these places we should be safe because the tree is in
the argument position, not somewhere where, for example,
a case class-es synthetic companion object might be
twice entered into the same scope.

Longer term, we'd like to make type checking side effect
free, so we wouldn't need to play whack-a-mole like this.
That idea is tracked under SI-7176.
SI-7232 Fix Java import vs defn. binding precendence

Java Spec:
> A single-type-import declaration d in a compilation unit c
> of package p that imports a type named n shadows, throughout
> c, the declarations of:
>   - any top level type named n declared in another compilation
>     unit of p
>   - any type named n imported by a type-import-on-demand
>     declaration in c
>   - any type named n imported by a static-import-on-demand
>     declaration in c

Scala Spec:
> Bindings of different kinds have a precedence deﬁned on them:
>   1. Deﬁnitions and declarations that are local, inherited, or made
>      available by a package clause in the same compilation unit where
>      the deﬁnition occurs have highest precedence.
>   2. Explicit imports have next highest precedence.
Restore sketchy dependency to quick.bin.

Apparently we cannot run at all without the continuations
classes on the classpath. At least that it was I conclude
from the fact that quick/bin/scala hasn't worked since
I routed the plugin classes into continuations-library.

This restores them to quick's classpath so we can have
qscala again.
Merge pull request #2254 from paulp/pr/buildxml

Restore sketchy dependency to quick.bin.
SI-7249 Reign in overzealous Function0 optimization.

The fix for SI-1247 went too far, and could result in
premature evaluation of the expression that yields the
Function0.

This commit checks that said expression is safe to inline.
If not, a wrapper `() => ....` is still required.

The optimization is still enabled in sitations like the
original test case, run/t1247.scala.