File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ sealed abstract class GadtConstraint extends Showable {
5555
5656 /** Restore the state from other [[GadtConstraint ]], probably copied using [[fresh ]] */
5757 def restore (other : GadtConstraint ): Unit
58+
59+ /** Provides more information than toText, by showing the underlying Constraint details. */
60+ def debugBoundsDescription (using Context ): String
5861}
5962
6063final class ProperGadtConstraint private (
@@ -290,6 +293,8 @@ final class ProperGadtConstraint private(
290293 override def constr = gadtsConstr
291294
292295 override def toText (printer : Printer ): Texts .Text = printer.toText(this )
296+
297+ override def debugBoundsDescription (using Context ): String = i " $this\n $constraint"
293298}
294299
295300@ sharable object EmptyGadtConstraint extends GadtConstraint {
@@ -314,4 +319,5 @@ final class ProperGadtConstraint private(
314319 assert(! other.isNarrowing, " cannot restore a non-empty GADTMap" )
315320
316321 override def toText (printer : Printer ): Texts .Text = printer.toText(this )
322+ override def debugBoundsDescription (using Context ): String = i " $this"
317323}
You can’t perform that action at this time.
0 commit comments