@@ -48,13 +48,13 @@ object Implicits {
4848 /** An implicit definition `implicitRef` that is visible under a different name, `alias`.
4949 * Gets generated if an implicit ref is imported via a renaming import.
5050 */
51- class RenamedImplicitDef (val implicitRef : TermRef , val alias : TermName ) extends ImplicitDef {
51+ class RenamedImplicitRef (val underlyingRef : TermRef , val alias : TermName ) extends ImplicitRef {
5252 def implicitName (implicit ctx : Context ): TermName = alias
5353 }
5454
5555 /** An eligible implicit candidate, consisting of an implicit reference and a nesting level */
56- case class Candidate (implicitDef : ImplicitDef , level : Int ) {
57- def ref : TermRef = implicitDef. implicitRef
56+ case class Candidate (implicitRef : ImplicitRef , level : Int ) {
57+ def ref : TermRef = implicitRef.underlyingRef
5858 }
5959
6060 /** A common base class of contextual implicits and of-type implicits which
@@ -68,7 +68,7 @@ object Implicits {
6868 def level : Int = 0
6969
7070 /** The implicit references */
71- def refs : List [ImplicitDef ]
71+ def refs : List [ImplicitRef ]
7272
7373 /** Return those references in `refs` that are compatible with type `pt`. */
7474 protected def filterMatching (pt : Type )(implicit ctx : Context ): List [Candidate ] = track(" filterMatching" ) {
@@ -147,7 +147,7 @@ object Implicits {
147147 else {
148148 val nestedCtx = ctx.fresh.addMode(Mode .TypevarsMissContext )
149149 refs
150- .filter(ref => nestedCtx.typerState.test(refMatches(ref.implicitRef )(nestedCtx)))
150+ .filter(ref => nestedCtx.typerState.test(refMatches(ref.underlyingRef )(nestedCtx)))
151151 .map(Candidate (_, level))
152152 }
153153 }
@@ -159,7 +159,7 @@ object Implicits {
159159 */
160160 class OfTypeImplicits (tp : Type , val companionRefs : TermRefSet )(initctx : Context ) extends ImplicitRefs (initctx) {
161161 assert(initctx.typer != null )
162- lazy val refs : List [ImplicitDef ] = {
162+ lazy val refs : List [ImplicitRef ] = {
163163 val buf = new mutable.ListBuffer [TermRef ]
164164 for (companion <- companionRefs) buf ++= companion.implicitMembers
165165 buf.toList
@@ -185,7 +185,7 @@ object Implicits {
185185 * name, b, whereas the name of the symbol is the original name, a.
186186 * @param outerCtx the next outer context that makes visible further implicits
187187 */
188- class ContextualImplicits (val refs : List [ImplicitDef ], val outerImplicits : ContextualImplicits )(initctx : Context ) extends ImplicitRefs (initctx) {
188+ class ContextualImplicits (val refs : List [ImplicitRef ], val outerImplicits : ContextualImplicits )(initctx : Context ) extends ImplicitRefs (initctx) {
189189 private val eligibleCache = new mutable.AnyRefMap [Type , List [Candidate ]]
190190
191191 /** The level increases if current context has a different owner or scope than
@@ -827,7 +827,7 @@ trait Implicits { self: Typer =>
827827 pt)
828828 val generated1 = adapt(generated, pt)
829829 lazy val shadowing =
830- typed(untpd.Ident (cand.implicitDef .implicitName) withPos pos.toSynthetic, funProto)(
830+ typed(untpd.Ident (cand.implicitRef .implicitName) withPos pos.toSynthetic, funProto)(
831831 nestedContext().addMode(Mode .ImplicitShadowing ).setExploreTyperState())
832832 def refSameAs (shadowing : Tree ): Boolean =
833833 ref.symbol == closureBody(shadowing).symbol || {
0 commit comments