diff --git a/library/src/main/scala/treehugger/TreePrinters.scala b/library/src/main/scala/treehugger/TreePrinters.scala index ed170dc..353e5f6 100644 --- a/library/src/main/scala/treehugger/TreePrinters.scala +++ b/library/src/main/scala/treehugger/TreePrinters.scala @@ -7,6 +7,7 @@ package treehugger import java.io.{ OutputStream, PrintWriter, StringWriter, Writer } import Flags._ +import treehugger.api.Modifier trait TreePrinters extends api.TreePrinters { self: Forest => @@ -309,7 +310,8 @@ trait TreePrinters extends api.TreePrinters { self: Forest => print(" ") printModifiers(tree, ctormods) } - if (vparams != Nil) printValueParams(vparams, true) + if (vparams != Nil || modifiersOfFlags(mods.flags).contains(Modifier.`case`)) + printValueParams(vparams, true) print(if (mods.isDeferred) " <: " else if (impl.parents.isEmpty) "" diff --git a/library/src/test/scala/DSL_2ClassSpec.scala b/library/src/test/scala/DSL_2ClassSpec.scala index 8cda0d4..3834a40 100644 --- a/library/src/test/scala/DSL_2ClassSpec.scala +++ b/library/src/test/scala/DSL_2ClassSpec.scala @@ -120,7 +120,7 @@ sealed classes `withFlags(Flags.SEALED)`. $c ) def caseclass1 = - ((CASECLASSDEF("C"): Tree) must print_as("case class C")) and + ((CASECLASSDEF("C"): Tree) must print_as("case class C()")) and ((CASECLASSDEF("C") withParams(VAL("x", IntClass) withFlags(Flags.OVERRIDE)) withParents(sym.Addressable APPLY(REF("x"))) := BLOCK( DEF("y") := LIT(0) ))