Skip to content

Commit 074c2c8

Browse files
author
Aleksander Boruch-Gruszecki
committed
Add specialized printer for GADT constraint
1 parent 0e79219 commit 074c2c8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/config/Printers.scala

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ object Printers {
2020
val dottydoc: Printer = noPrinter
2121
val exhaustivity: Printer = noPrinter
2222
val gadts: Printer = noPrinter
23+
val gadtsConstr: Printer = noPrinter
2324
val hk: Printer = noPrinter
2425
val implicits: Printer = noPrinter
2526
val implicitsDetailed: Printer = noPrinter

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ object Contexts {
724724
private[this] var boundCache: SimpleIdentityMap[Symbol, TypeBounds],
725725
private[this] var dirtyFlag: Boolean
726726
) extends GADTMap with ConstraintHandling {
727-
import dotty.tools.dotc.config.Printers.gadts
727+
import dotty.tools.dotc.config.Printers.{gadts, gadtsConstr}
728728

729729
def this() = this(
730730
myConstraint = new OrderingConstraint(SimpleIdentityMap.Empty, SimpleIdentityMap.Empty, SimpleIdentityMap.Empty),
@@ -734,6 +734,8 @@ object Contexts {
734734
dirtyFlag = false
735735
)
736736

737+
override def constr_println(msg: => String): Unit = gadtsConstr.println(msg)
738+
737739
override def debugBoundsDescription(implicit ctx: Context): String = {
738740
val sb = new mutable.StringBuilder
739741
sb ++= constraint.show

0 commit comments

Comments
 (0)