@@ -28,7 +28,7 @@ import Trees._
2828import transform .SymUtils ._
2929import transform .TypeUtils ._
3030import Hashable ._
31- import util .{SourceFile , NoSource }
31+ import util .{SourceFile , NoSource , IdentityHashMap }
3232import config .{Config , Feature }
3333import Feature .migrateTo3
3434import config .Printers .{implicits , implicitsDetailed }
@@ -289,7 +289,7 @@ object Implicits:
289289 * @param outerCtx the next outer context that makes visible further implicits
290290 */
291291 class ContextualImplicits (val refs : List [ImplicitRef ], val outerImplicits : ContextualImplicits )(initctx : Context ) extends ImplicitRefs (initctx) {
292- private val eligibleCache = new java.util. IdentityHashMap [Type , List [Candidate ]]
292+ private val eligibleCache = IdentityHashMap [Type , List [Candidate ]]()
293293
294294 /** The level increases if current context has a different owner or scope than
295295 * the context of the next-outer ImplicitRefs. This is however disabled under
@@ -316,7 +316,7 @@ object Implicits:
316316 def eligible (tp : Type ): List [Candidate ] =
317317 if (tp.hash == NotCached ) computeEligible(tp)
318318 else {
319- val eligibles = eligibleCache.get (tp)
319+ val eligibles = eligibleCache.lookup (tp)
320320 if (eligibles != null ) {
321321 def elided (ci : ContextualImplicits ): Int = {
322322 val n = ci.refs.length
@@ -329,7 +329,7 @@ object Implicits:
329329 else if (irefCtx eq NoContext ) Nil
330330 else {
331331 val result = computeEligible(tp)
332- eligibleCache.put (tp, result)
332+ eligibleCache(tp) = result
333333 result
334334 }
335335 }
@@ -528,7 +528,7 @@ trait ImplicitRunInfo:
528528
529529 private var provisional : Boolean = _
530530 private var parts : mutable.LinkedHashSet [Type ] = _
531- private val partSeen = TypeHashSet ()
531+ private val partSeen = util. HashSet [ Type ] ()
532532
533533 def traverse (t : Type ) =
534534 if partSeen.contains(t) then ()
@@ -566,8 +566,8 @@ trait ImplicitRunInfo:
566566 (parts, provisional)
567567 end collectParts
568568
569- val seen = TypeHashSet ()
570- val incomplete = TypeHashSet ()
569+ val seen = util. HashSet [ Type ] ()
570+ val incomplete = util. HashSet [ Type ] ()
571571
572572 def collectCompanions (tp : Type , parts : collection.Set [Type ]): TermRefSet =
573573 val companions = new TermRefSet
@@ -687,7 +687,7 @@ trait ImplicitRunInfo:
687687 record(i " implicitScope " )
688688 val liftToAnchors = new TypeMap :
689689 override def stopAtStatic = true
690- private val seen = TypeHashSet ()
690+ private val seen = util. HashSet [ Type ] ()
691691
692692 def applyToUnderlying (t : TypeProxy ) =
693693 if seen.contains(t) then
0 commit comments