Presentation compiler hyperlinking on context bounds test

Added test to the presentation compiler regression suite to exercise
hyperlinking on context bounds.
SI-4287 Added test demonstrating hyperlinking to constructor's argument

This test was inspired by `test/files/run/t5603`, whose output (.check file)
will need to be updated in the upcoming commit that fixes SI-4287, because
the positions associated to the tree have slightly changed.

The additional test should demonstrate that the change in positions isn't
relevant, and it doesn't affect functionality. In fact, hyperlinking to a
constructor's argument work as expected before and after fixing SI-4287.
SI-4827 Test to demonstrate wrong position of constructor default arg

As demonstrated by the attached test, hyperlinking on constructor's
default arg doesn't work (the returned tree is the parameter tree,
i.e., `f`, which is of course wrong).

Printing the tree reveals the issue:

``
[[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:31]<paramaccessor> private[this] val f: [14]Int = _;
    [14]<stable> <accessor> <paramaccessor> def f: [14]Int = [14][14]Baz.this.f;
    [39]def <init>([14]f: [17]<type: [17]scala.Int> = [30]B.a): [9]Baz = [39]{
      [39][39][39]Baz.super.<init>();
      [9]()
    }
  };

  [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
  }
}
``

In short, the default argument in `<init>` (the constructor) has an
offset position, while we would expect it to have a range position.
Therefore, when locating a tree for any position between (start=) 10
and (end=) 31, the paramaccessor tree `f` is returned.

The next commit will correct the problem.
SI-7974 Avoid calling nonPrivateMember after erasure

One example were this would lead to subtle bugs otherwise is
Symbol_apply, where after erasure an overloaded symbol containing
Symbol#apply and UniquenessCache#apply is returned.

    // findMember considered harmful after erasure; e.g.
    //
    // scala> exitingErasure(Symbol_apply).isOverloaded
    // res27: Boolean = true
SI-7974 Clean up and test 'Symbol-handling code in CleanUp

Looks like the transformation did never happen because the pattern
failed to match. Why did the pattern fail to match? Because the
Symbol.apply we see in the tree claims to be a method while
Symbol_apply defined in Definitions wants to be a value.

This issue was caused because nonPrivateMember starts spitting out
overloaded symbols after erasure.
This issue has been fixed in the earlier commit, so what happens in
this commit is adding tests and fixing documentation.
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.
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.
Fix typo in documentation
SI-7491 deprecate overriding App.main and clarify documentation

App.main should never be overridden, so let's enforce it.
SI-7859 fix AnyVal.scala scaladoc.

Value class member need not be public in 2.11+
More robust hyperlink tests for the presentation compiler

Report null symbols in an civilised manner, rather than with a NPE.
Test to show the bug with hyperlinking in macro arguments

Currently, the presentation compiler sees the expansion of macros;
this no longer contains the trees corresponding to the macro arguments,
and hyperlink requests result incorrect results.

https://www.assembla.com/spaces/scala-ide/tickets/1001449#
SI-8064 Automatic position repair for macro expansion

  - Replace NoPosition with the focus of the macro application
  - Focus all range positions, for example, those of spliced arguments
Use macro expandee, rather than expansion, in pres. compiler

The presentation compiler is primarily interested in trees that
represent the code that one sees in the IDE, not the expansion of
macros.

This commit continues to expand macros, but adds a hook in which
the presentation compiler discards the expansion, retaining instead
the expandee. The expandee is attributed with the type of the
expansion, which allows white box macros to work. In addition,
any domain specific errors and warnings issued by the macro will
still be reported, as a side-effect of the expansion.

The failing test from the last commit now correctly resolves
hyperlinks in macro arguments.

Related IDE ticket:

  https://www.assembla.com/spaces/scala-ide/tickets/1001449#

This facility is configured as follows:

    // expand macros as per normal
    -Ymacro-expand:normal

    // don't expand the macro, takes the place of -Ymacro-no-expand
    -Ymacro-expand:none

    // expand macros to compute type and emit warnings,
    // but retain expandee. Set automatically be the presentation
    // compiler
    -Ymacro-expand:discard

This leaves to door ajar for a new option:

    // Don't expand blackbox macros; expand whitebox
    // but retain expandee
    -Ymacro-expand:discard-whitebox-only

The existing test for SI-6812 has been duplicated. One copy exercises
the now-deprecated -Ymacro-no-expand, and the other uses the new
option.
Removes unnecessary generality in the macro engine

In Jan 2013, I submitted a number of pull requests that built up a foundation
for the upcoming type macros pull request. Unfortunately, type macros
ended up being rejected, but the extra generality introduced in advance
still persisted in the compiler until now.

This commit takes care of unused generality in the macro engine,
keeping the internal implementation as well as the public API clean.
Merge pull request #3341 from xuwei-k/anyval-scaladoc

SI-7859 fix AnyVal.scala scaladoc.
Merge pull request #3338 from gourlaysama/t7491

SI-7491 fix typo in scala.App documentation
Merge pull request #3269 from dotta/issue/si-4287

Issue/si 4287
Merge pull request #3149 from soc/SI-7974

 Fix broken 'Symbol-handling code in CleanUp
Merge pull request #3336 from OlivierBlanvillain/patch-1

Fix typo in documentation