This *might* be brittle in a compiler that doesn't have an "erasure" phase. (Maybe ScalaJS?)

How about?

```scala
  final def findPhaseBeforeErasure: Phase = {
     var ph = phase
     while (ph != NoPhase && ph.erasedTypes) {
       ph = ph.prev
     }
     if (ph eq NoPhase) phase else ph
   }
  ...
  enteringPhaseNotLaterThan(findPhaseBeforeErasure)(owner.info.nonPrivateMember(name))
```