Merge pull request #3548 from retronym/ticket/5165

SI-5165 separate compilation test Java annotations bug
Merge pull request #3529 from Ichoran/issue/8072

SI-8072 rationalize public implicits in scala parallel collections
Merge pull request #3552 from retronym/topic/opt12

Optimization: remove assertion from SubstMap constructor
Merge pull request #3545 from retronym/topic/8301

SI-8301 fix regression with refinement subtyping, wildcard type.
Merge pull request #3550 from retronym/ticket/7932

SI-7932 Exclude PolyTypes from Java generic signatures
Merge pull request #3538 from Blaisorblade/patch-2

README.md: Add link to CONTRIBUTING.md
Merge pull request #3537 from Blaisorblade/issue/6566

SI-6566, unsoundness with alias variance: document fix
SI-8229 Source compatible name for implicit any2stringadd

To support the established pattern for disabling it for
an compilation unit.

Update scaladoc's knowledge of our "typeclasses".

Leave a `private[scala]` version of `StringAdd` (public in bytecode)
to ensure binary compatibility with 2.11.0-M8 for partest.
SI-7788 Avoid accidental shadowing of Predef.conforms

Rename `conforms` to `$conforms` and put in a minimal backstop: pos/t7788.scala

TODO: predicate the backwards compatibility shim for `Predef_conforms`
on `-Xsource:2.10`
SI-4577 singleton type pattern test should use `eq`, not `==`

I find it hard to imagine anyone is relying on `case x: foo.type =>`
erroneously being compiled to `foo == x` instead of the spec'ed `foo eq x`,
so let's finally fix this.
SI-8224 Fix regression in f-bound aware LUBs

Disable the heuristic approach to recursive bounds unless
the compiler is running under `-Xstrict-inference`.
[the above was not authored by the original author]

In db46c71e88, steps were taken to avoid blowing up in the
pathological LUB calculation needed for:

    def trav = List(List(), Stream())

This skipped a level in the base class sequence when f-bounds
were detected at the current level.

In that example, when `lublist` was about to:

    mergePrefixAndArgs(
      typeOf[LinearSeqOptimized[A, List[A]]],
      typeOf[LinearSeqOptimized[A, Stream[A]]],
    )

If it proceeded (as in 2.10.3), the LUB is invalid:

    error: type arguments [B[_ >: D with C <: B[_ >: D with C <: A]],s.c.immutable.LinearSeq[B[_ >: D with C <: A]] with s.c.AbstractSeq[B[_ >: D with C <: A]] with s.c.LinearSeqOptimized[B[_ >: D with C <: A],s.c.immutable.LinearSeq[A] with s.c.AbstractSeq[A] with s.c.LinearSeqOptimized[A,Immutable with Equals with java.io.Serializable] with java.io.Serializable] with java.io.Serializable] do not conform to trait LinearSeqOptimized's type parameter bounds [+A,+Repr <: s.c.LinearSeqOptimized[A,Repr]]

To avoid this, the added code would skip to the first non-F-bounded
base type of the same arity of each element in the list. This would
get to:

    LinearSeqLike[D, Stream[D]]
    LinearSeqLike[C, List[C]]

which are lubbable without violating the type constraints.

I don't think this was the right remedy. For starters, as seen in
this bug report, SI-8224, if the list of types are identical we
have let a perfectly good lub slip through our fingers, and end up
calculating too general a type.

More generally, if the type arguments in f-bounded positions coincide,
we don't risk calculating a ill-bounded LUB.

Furthermore, the code was widening each of the types separately;
this isn't something we want to do within `if (isUniformFrontier)`.
AFAICT this was just wasteful and as all `ts0` start with the same
type symbol, so `typeConstructorList` should be uniform.

This commit restricts this base-class skipping to situations where
the argument inferred for an type argument that is used as an f-bound
is not:

    a) an existential (as created by `mergePrefixAndArgs` in invariant
      positions.), or
    b) equivalent to one of the corresponding input type arguments
       (this is the case that fixes the regression in pos/8224.scala)
Merge pull request #3452 from xeno-by/topic/palladium0

SI-8063 and its seventy friends
SI-8306: handle SWITCH nodes with just default case

Handle properly SWITCH nodes that contain just a default case in optimizer
(ConstantOptimization). SWITCH with just default case is expressed as a
node with empty tags and exactly one label. We can handle such nodes
easily by introducing a shortcut in logic that computes reachableLabels.

Add a test case which triggers patmat to generate SWITCH node with just
a default case.

Fixes SI-8306.
SI-1503 don't assume unsound type for ident/literal patterns

The fix only kicks in under -Xfuture. We also warn under -Xlint.

What type should a variable bound to the value matched by a pattern have?
To avoid CCEs, it should be a type that's implied by the matching
semantics of the pattern.

Usually, the type implied by a pattern matching a certain value
is the pattern's type, because pattern matching implies instance-of checks.

However, Stable Identifier and Literal patterns are matched using `==`,
which does not imply a type for the binder that binds the matched value.

The change in type checking due to this fix is that programs that used to crash with a CCE
(because we blindly cast to the type of the pattern, which a `==` check does not imply)
now get a weaker type instead (and no cast). They may still type check, or they may not.

To compensate for this fix, change `case x@Foo => x` to `case x: Foo.type => x`,
if it's important that `x` have type `Foo.type`.

See also:
- SI-4577: matching of singleton type patterns uses `eq`,
  not `==` (so that the types are not a lie).
- SI-5024: patmat strips unused bindings, but affects semantics
Attributed val/var processing for syntactics (SI-8180)
TypedTreesPrinter added
changes based on pull request comments:
print root packages flag; tests for syntactics; SyntacticEmptyTypeTree added to Printers
printers flag processing improvements: printRootPkg flag fixed, comments to flags metadata printing added
lazy vals printing fixed for typechecked trees
CodePrinter: TypedTreePrinter merged with ParsedTreePrinter
move methods for typechecked trees processing to TreeInfo
printOwners support added to Printers; whitespaces removed