File tree 1 file changed +6
-0
lines changed
compiler/src/dotty/tools/dotc/core
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 {
55
55
56
56
/** Restore the state from other [[GadtConstraint ]], probably copied using [[fresh ]] */
57
57
def restore (other : GadtConstraint ): Unit
58
+
59
+ /** Provides more information than toText, by showing the underlying Constraint details. */
60
+ def debugBoundsDescription (using Context ): String
58
61
}
59
62
60
63
final class ProperGadtConstraint private (
@@ -290,6 +293,8 @@ final class ProperGadtConstraint private(
290
293
override def constr = gadtsConstr
291
294
292
295
override def toText (printer : Printer ): Texts .Text = printer.toText(this )
296
+
297
+ override def debugBoundsDescription (using Context ): String = i " $this\n $constraint"
293
298
}
294
299
295
300
@ sharable object EmptyGadtConstraint extends GadtConstraint {
@@ -314,4 +319,5 @@ final class ProperGadtConstraint private(
314
319
assert(! other.isNarrowing, " cannot restore a non-empty GADTMap" )
315
320
316
321
override def toText (printer : Printer ): Texts .Text = printer.toText(this )
322
+ override def debugBoundsDescription (using Context ): String = i " $this"
317
323
}
You can’t perform that action at this time.
0 commit comments