scala/scala — pull request #3040 by xeno-by (2013-10-15 13:38:46+00:00)
Title: SI-7340 no longer allows to convert vampires to zombies

As eloquently elaborated and cleverly named by Travis Brown, macros
defined in structural types are useful:
http://meta.plasm.us/posts/2013/07/12/vampire-methods-for-structural-types/.

However, since such macros are on the intersection of a number of language
features, as usual, there are bugs.

Before this commit, subtyping checks between structural types didn't
distinguish regular methods structural types (zombies, as per Travis'
classification) and macros (vampires, again as per the same bestiary).

There's one detail though. Since implicit conversions are looked up using
structural types, that look like: "? { def foo: ? }", where question marks
stand for WildcardType, we need to allow such structural types to match
situations when the target member is a macro.

Unlike the original subtyping rule, this one is not a soundness hole,
because: 1) the way the compiler uses such types is guaranteed to be sound,
because they aren't assigned to any term and are discarded right away
after implicit search, 2) users can't actually write such types, so they
can't exploit the situations that lead to unsoundness.