Skip to content

Commit dd88672

Browse files
committed
refine propagation for idempotent maps
For an idempotent map f and a set C, we do not need to propagate x ∈ f(C) back to C when x comes from f(y) for some y ∈ C.
1 parent 7e695fd commit dd88672

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ object CaptureSet:
546546
else CompareResult.fail(this)
547547
}
548548
.andAlso {
549-
if (origin ne source) && mapIsIdempotent then
549+
if (origin ne source) && (origin ne initial) && mapIsIdempotent then
550550
// `tm` is idempotent, propagate back elems from image set.
551551
// This is sound, since we know that for `r in newElems: tm(r) = r`, hence
552552
// `r` is _one_ possible solution in `source` that would make an `r` appear in this set.

0 commit comments

Comments
 (0)