Skip to content

Commit ac4f6e7

Browse files
committed
improve tracing in GadtConstraint
1 parent a1d0e49 commit ac4f6e7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

compiler/src/dotty/tools/dotc/core/GadtConstraint.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,13 @@ final class ProperGadtConstraint private(
338338
val pathType = path.widen
339339
val typeMembers = constrainableTypeMembers(path).filterNot(_.symbol eq NoSymbol)
340340

341-
gadts.println(i"> trying to add $path into constraint ...")
342-
gadts.println(i" path.widen = $pathType")
343-
gadts.println(i" type members =\n${debugShowTypeMembers(typeMembers)}")
341+
gadts.println {
342+
val sb = new mutable.StringBuilder()
343+
sb ++= i"* trying to add $path into constraint ...\n"
344+
sb ++= i"** path.widen = $pathType\n"
345+
sb ++= i"** type members =\n${debugShowTypeMembers(typeMembers)}\n"
346+
sb.result()
347+
}
344348

345349
typeMembers.nonEmpty && {
346350
val typeMemberSymbols: List[Symbol] = typeMembers map { x => x.symbol }
@@ -411,7 +415,7 @@ final class ProperGadtConstraint private(
411415
}
412416

413417
addToConstraint(poly1, tvars)
414-
.showing(i"added to constraint: [$poly1] $path\n$debugBoundsDescription", gadts)
418+
.showing(i"added to constraint: [$poly1] $path, result = $result\n$debugBoundsDescription", gadts)
415419
}
416420
}
417421

0 commit comments

Comments
 (0)