File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -640,7 +640,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
640640 val tparamsTxt = withEnclosingDef(constr) { tparamsText(tparams) }
641641 val primaryConstrs = if (constr.rhs.isEmpty) Nil else constr :: Nil
642642 val prefix : Text =
643- if (constr.symbol.owner.is(Module )) " "
643+ if (constr.symbol.owner.is(Module )) " "
644644 else if (vparamss.isEmpty || primaryConstrs.nonEmpty) tparamsTxt
645645 else {
646646 var modsText = modText(constr.mods, " " )
@@ -661,7 +661,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
661661 params ::: rest
662662 } else impl.body
663663
664- val bodyText = " {" ~~ selfText ~~ toTextGlobal(primaryConstrs ::: body, " \n " ) ~ " }"
664+ val bodyText =
665+ (if (constr.symbol.owner.is(Module )) " {" else " {" ) ~~
666+ selfText ~~ toTextGlobal(primaryConstrs ::: body, " \n " ) ~ " }"
665667
666668 prefix ~ (keywordText(" extends" ) provided (! ofNew && parents.nonEmpty)) ~~ parentsText ~~ bodyText
667669 }
Original file line number Diff line number Diff line change 11/** Decompiled from out/posTestFromTasty/pos/simpleCaseObject/foo/Foo.class */
22package foo {
3- case object Foo {
3+ case object Foo {
44 override def hashCode(): Int = 1045991777
55 override def toString(): String = "Foo"
66 override def canEqual(that: Any): Boolean =
Original file line number Diff line number Diff line change 11/** Decompiled from out/runTestFromTasty/run/puzzle/Test.class */
2- object Test {
2+ object Test {
33 def main(args: Array[String]): Unit =
44 {
55 println(if false then 5.0 else 53.0)
You can’t perform that action at this time.
0 commit comments