Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,17 @@ object Implicits {
if (monitored) record(s"elided eligible refs", elided(this))
eligibles
case None =>
val savedEphemeral = ctx.typerState.ephemeral
ctx.typerState.ephemeral = false
try {
val result = computeEligible(tp)
if (ctx.typerState.ephemeral) record("ephemeral cache miss: eligible")
else eligibleCache(tp) = result
result
if (ctx eq NoContext) Nil
else {
val savedEphemeral = ctx.typerState.ephemeral
ctx.typerState.ephemeral = false
try {
val result = computeEligible(tp)
if (ctx.typerState.ephemeral) record("ephemeral cache miss: eligible")
else eligibleCache(tp) = result
result
} finally ctx.typerState.ephemeral |= savedEphemeral
}
finally ctx.typerState.ephemeral |= savedEphemeral
}
}

Expand Down