Skip to content

Commit d5be8db

Browse files
committed
Fix upperApprox
1 parent 25d96b6 commit d5be8db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,9 @@ object CaptureSet:
532532
* of this set. The universal set {cap} is a sound fallback.
533533
*/
534534
final def upperApprox(origin: CaptureSet)(using Context): CaptureSet =
535-
if isConst || elems.exists(_.isRootCapability) then this
535+
if isConst then this
536+
else if elems.exists(_.isRootCapability) then
537+
CaptureSet(elems.filter(_.isRootCapability).toList*)
536538
else if computingApprox then universal
537539
else
538540
computingApprox = true

0 commit comments

Comments
 (0)