Closes SI-6952: add correct error positions for Dynamic feature check.
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
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.
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
Use the same default scalac options in all three partest frontends

Make ConsoleRunner, AntRunner and SBTRunner take scalac options from
"partest.scalac_opts" property.

Also remove leftover "-deprecation" option from test/partest.

The change to SBTRunner was not tested as sbt test is currently broken.
[backport] Fix SI-6637 (misoptimization in erasure)

commit f9ef5300ab561628e53c654df9000c75f488d74a
Author: Jan Niehusmann <jan@gondor.com>
Date:   Fri Nov 9 15:05:58 2012 +0100

    Fix SI-6637 (misoptimization in erasure)

    Move the optimization one level deeper so the expression
    being tested with isInstanceOf is always evaluated.
    (cherry picked from commit b540aaee4ba30e2dd980456a44e8c6d732222df1)
[backport] Fix unsafe array opt. / opt. primitive Array(...)

SI-6611, SI-6247 (partial fix)

The original commits on master were a bit circuitous, this
is squashed to a neat little package.

I had to add type arguments to the Array.apply calls in the
test case, they are inferred on master.

commit 41ff05dfdbcf032157b3509ace633f2e7a12295c
Author: Jason Zaugg <jzaugg@gmail.com>
Date:   Sun Nov 4 14:44:59 2012 +0100

    Refactor guards checking for a particular overload of Array.apply.
    (cherry picked from commit 092345a24c22a821204fb358d33272ae8f7353be)

commit 1e5c942deccaf64f8d57bd8891b912381d7f220a
Author: Jason Zaugg <jzaugg@gmail.com>
Date:   Sun Nov 4 14:17:25 2012 +0100

    Expand optimization of Array(e1, ..., en) to primitive arrays.
    (cherry picked from commit 8265175ecc42293997d59049f430396c77a2b891)

commit ab1bf77e39f2dfeacf3fc107ccb2907a1867f04c
Author: Jason Zaugg <jzaugg@gmail.com>
Date:   Sat Nov 3 13:34:20 2012 +0100

    SI-6611 Tighten up an unsafe array optimization

    The net was cast too wide and was unsafely optimizing away array
    copies.
    (cherry picked from commit dad886659faca4fba2d4937c9bc6780591b02c27)

And also:

Optimize primitive Array(e1, ..., en)

Expands an existing optimization for reference arrays to
apply to primitives, as well.

Fixes one aspect of SI-6247.
(cherry picked from commit cac5a08611f9511ba4d94b99db630404efae190a)

Conflicts:
	src/compiler/scala/tools/nsc/transform/CleanUp.scala

More principled tree copying.

Canonical > home-spun.

Conflicts:
	src/compiler/scala/tools/nsc/transform/CleanUp.scala
[backport] SI-6567 Warning for Option(implicitView(foo))

commit 284bd754fa5dfc8bc626b0c5ebe85d872dd044cb
Author: Jason Zaugg <jzaugg@gmail.com>
Date:   Sat Nov 3 16:19:46 2012 +0100

    SI-6567 Warning for Option(implicitView(foo))

    I've seen the reported problem before in the wild. It seems
    worthy of a special warning, so long as we advocate Option.apply
    as an alternative to `if (x == null) Some(x) else None`.

    It is behind -Xlint at the moment, an option that could do with
    some promotion.
    (cherry picked from commit 0bcb9e9169146e3f589c6c9f65cc4a5523b78120)
Merge pull request #1958 from JamesIry/SI-6434_2.10.x

SI-6434 Pretty print function types with by name arg as (=> A) => B
Fix class loader issues in instrumentation tests.

The ASM ClassWriter uses a wimpy class loader when computing common
superclasses. This could cause a ClassNotFoundException in the
transform method (at reader.accept). This exception gets swallowed,
resulting in a class that should be instrumented to silently not
be. The fix is to override getCommonSuperClass to use the correct
class loader.

Trivia: This bug was discovered while 'stress-testing' this
instrumentation scheme on the Coursera students, to check that they
implement one method in terms of another in the assignment.
Correct whitespace in `ASMTransformer.java`.

Let's stick to 2 spaces for indentation (and no tabs).
Set `canRetransform` flag to `false` in instrumentation.

We do not need to retransform classes once they are loaded.
All instrumentation byte-code is pushed at loading time.

This fixes a problem with Java 7 that was failing to add
a transformer because we did not declare retransformation
capability in `MANIFEST.MF` file in Java agent jar.
Java 6 allowed to add transformer due to a bug.
Do not recompute stack frames when instrumenting bytecode.

It turns out that we do not need to do that. See comment in
`ProfilerVisitor.java`. Also, since recomputing stack frame
map was the only reason we needed to implement
`getCommonSuperClass` we can now remove its implementation
that was causing problems on Java 7 due to a cyclic dependency
involving class loader because we would try to load a class
we are currently transforming and transformer is triggered just
before classloading.

//cc @namin who worked on this code with me.
Fix broken build.

It's all system admin, all the time, here at scala ranch.
Merge pull request #1968 from paulp/pr/fixbuild

Fix broken build.
Merge pull request #1935 from retronym/ticket/6994

SI-6994 Avoid spurious promiscuous catch warning