scala/scala — pull request #2574 by paulp (2013-05-21 08:22:15+00:00)
Title: SI-3425 erasure crash with refinement members.

Checking that a refinement class symbol does not override any symbols does
mean it will have to be invoke reflectively; but the converse is not true. It
can override other symbols and still have to be called reflectively, because
the overridden symbols may also be defined in refinement classes.

scala> class Foo { type R1 <: { def x: Any } ; type R2 <: R1 { def x: Int }
}
defined class Foo

scala> typeOf[Foo].member(TypeName("R2")).info.member("x":
TermName).overrideChain
res1: List[$r.intp.global.Symbol] = List(method x, method x)

scala> res1 filterNot (_.owner.isRefinementClass)
res2: List[$r.intp.global.Symbol] = List()

And checking that "owner.info decl name == this" only works if name is not
overloaded.

So the logic is all in "isOnlyRefinementMember" now, and let's hope that
suffices for a while.