File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
compiler/src/dotty/tools/dotc/cc Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,12 @@ object CaptureSet:
563563 else
564564 computingApprox = true
565565 try
566- val approx = computeApprox(origin).ensuring(_.isConst)
566+ val approx =
567+ try
568+ computeApprox(origin).ensuring(_.isConst)
569+ catch
570+ case ex : Throwable =>
571+ throw IllegalArgumentException (s " error computing upperApprox for $this and origin $origin" )
567572 if approx.elems.exists(Existential .isExistentialVar(_)) then
568573 ccState.approxWarnings +=
569574 em """ Capture set variable $this gets upper-approximated
@@ -778,9 +783,13 @@ object CaptureSet:
778783 * These situations are modeled by the two branches of the conditional below.
779784 */
780785 override def computeApprox (origin : CaptureSet )(using Context ): CaptureSet =
781- val supApprox = super .computeApprox(this )
782- if source eq origin then supApprox.map(bimap.inverse)
783- else source.upperApprox(this ).map(bimap) ** supApprox
786+ try
787+ val supApprox = super .computeApprox(this )
788+ if source eq origin then supApprox.map(bimap.inverse)
789+ else source.upperApprox(this ).map(bimap) ** supApprox
790+ catch
791+ case ex : Throwable =>
792+ throw IllegalArgumentException (s " error computing computeApprox for $this and origin $origin" )
784793
785794 override def isMaybeSet : Boolean = bimap.isInstanceOf [MaybeMap ]
786795 override def toString = s " BiMapped $id( $source, elems = $elems) "
You can’t perform that action at this time.
0 commit comments