scala/scala — pull request #3521 by xeno-by (2014-02-13 03:06:19+00:00)
Title: SI-8270 unconfuses bundles and vanilla macros

This fixes a mistake in macro impl ref typechecking that used to have
an heuristic to figure out whether it looks at a bundle method ref or at
a vanilla object method ref. Under some circumstances the heuristic could
fail, and then the macro engine would reject perfectly good macro impls.

Now every macro impl ref is typechecked twice - once as a bundle method ref
and once as a vanilla object method ref. Results are then analyzed,
checked against ambiguities (which are now correctly reported instead
of incorrectly prioritizing towards bundles) and delivered to the macro
engine.

The only heuristic left in place is the one that's used to report errors.
If both bundle and vanilla typechecks fail, then if a bundle candidate
looks sufficiently similar to a bundle, a bundle typecheck error is reported
providing some common bundle definition hints.