Skip to content

Commit 45728af

Browse files
committed
Embed accountsFor info in regular explain traces
1 parent edd40bc commit 45728af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,13 @@ sealed abstract class CaptureSet extends Showable:
158158
* as frozen.
159159
*/
160160
def accountsFor(x: CaptureRef)(using Context): Boolean =
161-
reporting.trace(i"$this accountsFor $x, ${x.captureSetOfInfo}?", show = true):
161+
def debugInfo(using Context) = i"$this accountsFor $x, which has capture set ${x.captureSetOfInfo}"
162+
def test(using Context) = reporting.trace(debugInfo):
162163
elems.exists(_.subsumes(x))
163164
|| !x.isMaxCapability && x.captureSetOfInfo.subCaptures(this, frozen = true).isOK
165+
comparer match
166+
case comparer: ExplainingTypeComparer => comparer.traceIndented(debugInfo)(test)
167+
case _ => test
164168

165169
/** A more optimistic version of accountsFor, which does not take variable supersets
166170
* of the `x` reference into account. A set might account for `x` if it accounts

0 commit comments

Comments
 (0)