SI-8120 Avoid tree sharing when typechecking patmat anon functions

When typechecking an empty selector `Match` corresponding to:

    { case ... => ... }: (A => B)

We wrap it in a `Function` and typecheck:

    (x$1 => x$1 match { case ... => ... })

Local symbols in this expression (representing values bound by
the pattern, or just definitions in the body or guard) are then
owned by the anonymous function's symbol.

However, if we ever discard this `Function` and start anew with
the empty selector match, as happens during the fallback to
use a view on the receiver in `tryTypedApply`, we found that we
had mutated the cases of the original tree, and allowed orphaned
local symbols to escape into the compiler pipeline.

This commit uses duplicated trees for the the cases in the synthetic
`Match` to avoid this problem.

`duplicateAndKeepPositions` is used to preserve range positions;
without this scala-refactoring PrettyPrinterTest fails.
`Tree#duplicate` uses offset positions in the copied tree, which
is appropriate when both the original and the copy are going to end up
in the final tree.
awakens default getter synthesis from the untyper nightmare

Our happy little macro paradise is regularly invaded by resetAllAttrs,
the bane of all macros and typers. It’s so ruthless and devastating that
we’ve been long scheming to hack something really cool and to one day
defeat it.

Today we make the first step towards the happy future. Today we overthrow
the UnTyper, resetAllAttrs’s elder brother that rules in the kingdoms of
GetterLand and CaseClassia, and banish him from the land of getters.
In the name of what’s good and meta, let’s band together and completely
drive him away in a subsequent pull request!

To put it in a nutshell, instead of using untyper on a DefDef to do
default getter synthesis, the commit duplicates the DefDef and does
resetLocalAttrs on it.

As default getter synthesis proceeds with figuring out type and value
parameters for the getter, then its tpt and finally its rhs, the commit
destructures the duplicated DefDef and then assembles the default getter
from the destructured parts instead of doing copyUntyped/copyUntypedInvariant
on the original DefDef.

I would say the test coverage is pretty good, as I had to figure out
3 or 4 test failures before I got to the stage when everything worked.
Iirc it tests pretty exotic stuff like polymorphic default parameters
in both second and third parameter lists, so it looks like we're pretty
good in this department.
untyper is no more

Unlike with default getters, removing untyper from case class synthesis
was trivial. Just resetLocalAttrs on a duplicate of the provided class def,
and that’s it.

resetAllAttrs, you’re next. We’ll get to you! Eventually...
ExistentialTypeTree.whereClauses are now MemberDefs

Today’s flight back to Lausanne wasn’t as productive as the recent flight
to Minsk (https://github.com/scala/scala/pull/3305), but I noticed
one minor thingie: ExistentialTypeTree had an imprecise type specified
for its whereClauses. This is now fixed.

I didn’t increment PickleFormat.*Version numbers, because this change
introduces only a miniscule incompatibility with what would have been
a meaningless and most likely crash-inducing pickle anyway.
License formatting tweak, RTF version.

To avoid duplication in scala/scala-dist, where it'll just go stale.
SI-4841 CLI help update for -Xplugin

The argument to `-Xplugin` is now a comma-separated list of paths.
This commit updates the option descriptor and a code comment.
Fixes #3330 with Scaladoc changes only
Merge pull request #3305 from xeno-by/topic/copy-untyped

awakens default getter synthesis from the untyper nightmare
SI-8111 Expand the comment with a more detailed TODO

As everone knows, undo/reset/retype/rollback are bandaids; we
should try to treat the disease more directly.
SI-4827 Corrected positions assigned to constructor's default arg

* Default arguments are always retained on the <init> method (i.e.,
  the class' constructor). Therefore, when the <init> parameters are
  created, we need to use `duplicateAndKeepPositions` to make sure that
  if a default argument is present, its opaque position is retained as
  well. This is necessary because when parameter accessors (i.e.,
  `fieldDefs`) are created, all default arguments are discared ( as you
  can see in the code, the right-hand-side of a `field` is always an
  `EmptyTree`) - see changes in TreeGen.scala

* When constructing the `fieldDefs`, it is important to adapt their
  range position to avoid overlappings with the positions of default
  arguments. It is worth noting that updating the field's end position
  to `vd.rhs.pos.start` would be incorrect, because `askTypeAt(pos)`
  could return the incorrect tree when the position is equal to
  `vd.rhs.pos.start` (because two nodes including that point position
  would exist in the tree, and `CompilerControl.locateTree(pos)` would
  return the first tree that includes the passed `pos`). This is why
  `1` is subtracted to `vd.rhs.pos.start`. Alternatively, we could have
  used `vd.tpt.pos.end` with similar results. However the logic would
  have become slightly more complex as we would need to handle the case
  where `vd.tpt` doesn't have a range position (for instance, this can
  happen if `-Yinfer-argument-types` is enabled). Therefore, subtracting
  `1` from `vd.rhs.pos.start` seemed the cleanest solution at the
  moment. - see changes in TreeGen.scala.

* If the synthetic constructor contains trees with an opaque range
  position (see point above), it must have a transparent position.
  This can only happen if the constructor's parameters' positions are
  considered, which is why we are now passing `vparamss1` to
  `wrappingPos` - see changes in TreeGen.scala.

* The derived primary constructor should have a transparent position
  as it may contain trees with an opaque range position. Hence, the
  `primaryCtor` position is considered for computing the position of the
  derived constructor - see change in Typers.scala.

Finally, below follows the printing of the tree for test t4287, which
you should compare with the one attached with the previous commit
message:

```
[[syntax trees at end of typer]] // Foo.scala
[0:63]package [0:0]<empty> {
  [0:37]class Baz extends [9:37][39]scala.AnyRef {
    [10:20]<paramaccessor> private[this] val f: [14]Int = _;
    [14]<stable> <accessor> <paramaccessor> def f: [14]Int = [14][14]Baz.this.f;
    <10:31>def <init>(<10:31>f: [17]<type: [17]scala.Int> = [23:31]B.a): [9]Baz = <10:31>{
      <10:31><10:31><10:31>Baz.super.<init>();
      <10:31>()
    }
  };
  [6]<synthetic> object Baz extends [6][6]AnyRef {
    [6]def <init>(): [9]Baz.type = [6]{
      [6][6][6]Baz.super.<init>();
      [9]()
    };
    [14]<synthetic> def <init>$default$1: [14]Int = [30]B.a
  };
  [39:63]object B extends [48:63][63]scala.AnyRef {
    [63]def <init>(): [48]B.type = [63]{
      [63][63][63]B.super.<init>();
      [48]()
    };
    [52:61]private[this] val a: [56]Int = [60:61]2;
    [56]<stable> <accessor> def a: [56]Int = [56][56]B.this.a
  }
}
```

You should notice that the default arg of `Baz` constructor now has a
range position. And that explains why the associated test now returns
the right tree when asking hyperlinking at the location of the default
argument.
Merge pull request #3301 from Ichoran/issue/7837

Resolves SI-7837, failure in quickSort.
Merge pull request #3306 from Ichoran/topic/junit-set-map

Improved testing framework for sets and maps.
Merge pull request #3325 from clhodapp/fix/double.abs

Fix  (postfix abs for -0.0)
Merge pull request #3331 from retronym/ticket/8120

SI-8120 Avoid tree sharing when typechecking patmat anon functions
Merge pull request #3289 from soc/SI-7492-redux

SI-7492 Make scala.runtime.MethodCache private[scala]
Fix typo in documentation
Update man pages for scala and scalac.

They had fallen quite a bit behind the output of
"scalac -X" and "scalac -Xshow-phases".
SI-8015 Count lines by EOLs

Source lines were counted by "line break chars", including FF.
Clients of `pos.line` seem to all expect the ordinary line num,
so that is what they get.

Unicode processing now precedes line ending processing.
SI-8015 Unprintables in messages

The line content to display should include the whole line,
inclusive of embedded line breaks, and any control chars
should be displayed in unicode escape.
SI-8015 Carat => Caret

Just a diamond in the rough.

Wikipedia warns against confusing it with "carrot."

The first word should really be pronounced as the garage phrase,
"Where's the car at?" and the second like "beret."