Merge pull request #1581 from lrytz/typerComment

comment / question in typers
SI-6624 set info of case pattern binder to help find case field accessors

sometimes the type checker infers a weird type for a sub-pattern of a case class/extractor pattern
this confuses the pattern matcher and it can't find the case field accessors for the sub-pattern

use the expected argument type of the extractor corresponding to the case class that we're matching
as the info for the sub-pattern binder -- this type more readily admits querying its caseFieldAccessors
SI-6677 Insert required cast in `new qual.foo.T`

Short version: we sometimes need to rewrite this as

    new T(qual.asInstanceOf[OwnerOfFoo].foo)

Long version:

`adaptMember` in Erasure performs a few tasks, among them:

1. adding an empty argument list to qualifiers in `new qual.T`
    for which `qual` is a val template member that has
    (post uncurry) a MethodType with an empty parameter list.

    The same rewriting was already applied in uncurry for such
    qualifiers appearing in other contexts, e.g. `qual.foo` was
    already rewritten to `qual().foo`.
2. casting, if necessary, the qualifier in `Select(qual, name)`
    to the type of owner of the symbol that this selection
    references.

    This can be neccesary with compound types:
     - some val class member has type `A with B`;
     - we instantiate `new ab.valMemberOfB.T`
     - we must pass `ab.valMemberOfB` to the constructor of `T`
       as the `$outer` pointer
     - we must cast `ab` to `B` before calling `valMemberOfB`.

    Failure to insert this cast can lead to a LinkageError or
    a VerifyError.

However, if 1) was performed, 2) was not.

The error is pretty easy to trigger with the new reflection
API:

    class Test {
      val cm: reflect.runtime.universe.Mirror
          = reflect.runtime.currentMirror
      def error {
        new cm.universe.Traverser // java.lang.VerifyError
      }

      def okay1 {
        val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror
        new cm.universe.Traverser
      }
    }

The fix applied here to `adaptMember` mirrors the existing
implementation of `adaptType`.
Restore the opimization apparently lost after merge.
Refactoring of adaptMethod

Avoid the early return, and address micro-duplication
between adaptType and adaptMember.
SI-6673 fixes macro problems with eta expansions

Eta expansions previously caused the typer to disable macros. That was
done in order to detect eta expansion of macro defs and show the user
an appropriate error message.

Macros were disabled because to find out whether we're expanding
a macro def, we need to get its symbol, and to get a symbol of something
we need to typecheck that something. However typechecking automatically
expands macros, so, unless we disable macros, after a typecheck we won't
be able to analyze macro occurrences anymore.

Unfortunately this solution has a fatal flaw. By disabling macros we
not only prevent the eta-expandee from macro expanding, but also all
the subtrees of that eta-expandee (see SI-6673).

This commit adds a mechanism for fine-grained control over macro
expansion. Now it's possible to prohibit only the node, but not its
children from macro expanding.
adds comments to standard attachments
Merge pull request #1638 from adriaanm/ticket-6624

SI-6624 better lookup of case field accessors for case class pattern with complicated type
Merge pull request #1607 from retronym/ticket/6640

SI-6640 Better reporting of deficient classpaths.
Merge pull request #1628 from axel22/issue/6150-backport

Fixes SI-6150 - backport to 2.10.x branch.
Merge pull request #1626 from paulp/issue/6357

Fix for SI-6357, cycle with value classes.
Fix for SI-6357, cycle with value classes.

Don't force the owner info.
Removed unused imports in swing.
Remove unused imports in partest.
Remove unused imports in continuations.
Remove unused imports in library.
Deal with possibly spurious warning in Macros.
applyOrElse is a synthetic method.
Commenting out unused members.

I want to get this commit into the history because
the tests pass here, which demonstrates that every commented
out method is not only unnecessary internally but has zero
test coverage. Since I know (based on the occasional source
code comment, or more often based on knowing something about
other source bases) that some of these can't be removed
without breaking other things, I want to at least record
a snapshot of the identities of all these unused and
untested methods.

This commit will be reverted; then there will be another
commit which removes the subset of these methods which I
believe to be removable. The remainder are in great need of
tests which exercise the interfaces upon which other
repositories depend.
Revert "Commenting out unused members."

This reverts commit 951fc3a486.