Skip to content

Commit c30af3c

Browse files
oderskymilessabin
authored andcommitted
Add desugar Printer
Aim: better diagnostic for what is desugared
1 parent 6fda1f3 commit c30af3c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import reporting.diagnostic.messages._
1515
import reporting.trace
1616
import annotation.constructorOnly
1717
import printing.Formatting.hl
18+
import config.Printers
1819

1920
import scala.annotation.internal.sharable
2021

@@ -51,7 +52,7 @@ object desugar {
5152
private type VarInfo = (NameTree, Tree)
5253

5354
/** Is `name` the name of a method that can be invalidated as a compiler-generated
54-
* case class method that clashes with a user-defined method?
55+
* case class method if it clashes with a user-defined method?
5556
*/
5657
def isRetractableCaseClassMethodName(name: Name)(implicit ctx: Context): Boolean = name match {
5758
case nme.apply | nme.unapply | nme.unapplySeq | nme.copy => true
@@ -765,7 +766,7 @@ object desugar {
765766
}
766767

767768
flatTree(cdef1 :: companions ::: implicitWrappers)
768-
}
769+
}.reporting(res => i"desugared: $res", Printers.desugar)
769770

770771
/** Expand
771772
*

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ object Printers {
1919
val cyclicErrors: Printer = noPrinter
2020
val debug = noPrinter // no type annotation here to force inlining
2121
val derive: Printer = noPrinter
22+
val desugar: Printer = noPrinter
2223
val dottydoc: Printer = noPrinter
2324
val exhaustivity: Printer = noPrinter
2425
val gadts: Printer = noPrinter

0 commit comments

Comments
 (0)