@@ -48,13 +48,13 @@ object Implicits {
48
48
/** An implicit definition `implicitRef` that is visible under a different name, `alias`.
49
49
* Gets generated if an implicit ref is imported via a renaming import.
50
50
*/
51
- class RenamedImplicitDef (val implicitRef : TermRef , val alias : TermName ) extends ImplicitDef {
51
+ class RenamedImplicitRef (val underlyingRef : TermRef , val alias : TermName ) extends ImplicitRef {
52
52
def implicitName (implicit ctx : Context ): TermName = alias
53
53
}
54
54
55
55
/** 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
58
58
}
59
59
60
60
/** A common base class of contextual implicits and of-type implicits which
@@ -68,7 +68,7 @@ object Implicits {
68
68
def level : Int = 0
69
69
70
70
/** The implicit references */
71
- def refs : List [ImplicitDef ]
71
+ def refs : List [ImplicitRef ]
72
72
73
73
/** Return those references in `refs` that are compatible with type `pt`. */
74
74
protected def filterMatching (pt : Type )(implicit ctx : Context ): List [Candidate ] = track(" filterMatching" ) {
@@ -147,7 +147,7 @@ object Implicits {
147
147
else {
148
148
val nestedCtx = ctx.fresh.addMode(Mode .TypevarsMissContext )
149
149
refs
150
- .filter(ref => nestedCtx.typerState.test(refMatches(ref.implicitRef )(nestedCtx)))
150
+ .filter(ref => nestedCtx.typerState.test(refMatches(ref.underlyingRef )(nestedCtx)))
151
151
.map(Candidate (_, level))
152
152
}
153
153
}
@@ -159,7 +159,7 @@ object Implicits {
159
159
*/
160
160
class OfTypeImplicits (tp : Type , val companionRefs : TermRefSet )(initctx : Context ) extends ImplicitRefs (initctx) {
161
161
assert(initctx.typer != null )
162
- lazy val refs : List [ImplicitDef ] = {
162
+ lazy val refs : List [ImplicitRef ] = {
163
163
val buf = new mutable.ListBuffer [TermRef ]
164
164
for (companion <- companionRefs) buf ++= companion.implicitMembers
165
165
buf.toList
@@ -185,7 +185,7 @@ object Implicits {
185
185
* name, b, whereas the name of the symbol is the original name, a.
186
186
* @param outerCtx the next outer context that makes visible further implicits
187
187
*/
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) {
189
189
private val eligibleCache = new mutable.AnyRefMap [Type , List [Candidate ]]
190
190
191
191
/** The level increases if current context has a different owner or scope than
@@ -827,7 +827,7 @@ trait Implicits { self: Typer =>
827
827
pt)
828
828
val generated1 = adapt(generated, pt)
829
829
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)(
831
831
nestedContext().addMode(Mode .ImplicitShadowing ).setExploreTyperState())
832
832
def refSameAs (shadowing : Tree ): Boolean =
833
833
ref.symbol == closureBody(shadowing).symbol || {
0 commit comments