@@ -131,7 +131,7 @@ object Implicits {
131
131
* name, b, whereas the name of the symbol is the original name, a.
132
132
* @param outerCtx the next outer context that makes visible further implicits
133
133
*/
134
- class ContextualImplicits (val refs : List [TermRef ], val outerCtx : Context )(initctx : Context ) extends ImplicitRefs (initctx) {
134
+ class ContextualImplicits (val refs : List [TermRef ], val outerImplicits : ContextualImplicits )(initctx : Context ) extends ImplicitRefs (initctx) {
135
135
private val eligibleCache = new mutable.AnyRefMap [Type , List [TermRef ]]
136
136
137
137
/** The implicit references that are eligible for type `tp`. */
@@ -141,8 +141,8 @@ object Implicits {
141
141
case Some (eligibles) =>
142
142
def elided (ci : ContextualImplicits ): Int = {
143
143
val n = ci.refs.length
144
- if (ci.outerCtx == NoContext ) n
145
- else n + elided(ci.outerCtx.implicits )
144
+ if (ci.outerImplicits == null ) n
145
+ else n + elided(ci.outerImplicits )
146
146
}
147
147
if (monitored) record(s " elided eligible refs " , elided(this ))
148
148
eligibles
@@ -156,16 +156,16 @@ object Implicits {
156
156
private def computeEligible (tp : Type ): List [TermRef ] = /* >|>*/ ctx.traceIndented(i " computeEligible $tp in $refs%, % " , implicitsDetailed) /* <|<*/ {
157
157
if (monitored) record(s " check eligible refs in ctx " , refs.length)
158
158
val ownEligible = filterMatching(tp)
159
- if (outerCtx == NoContext ) ownEligible
159
+ if (outerImplicits == null ) ownEligible
160
160
else ownEligible ::: {
161
161
val shadowed = (ownEligible map (_.name)).toSet
162
- outerCtx.implicits .eligible(tp) filterNot (ref => shadowed contains ref.name)
162
+ outerImplicits .eligible(tp) filterNot (ref => shadowed contains ref.name)
163
163
}
164
164
}
165
165
166
166
override def toString = {
167
167
val own = s " (implicits: ${refs mkString " ," }) "
168
- if (outerCtx == NoContext ) own else own + " \n " + outerCtx.implicits
168
+ if (outerImplicits == null ) own else own + " \n " + outerImplicits
169
169
}
170
170
}
171
171
0 commit comments