File tree 3 files changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/printing
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) {
640
640
val tparamsTxt = withEnclosingDef(constr) { tparamsText(tparams) }
641
641
val primaryConstrs = if (constr.rhs.isEmpty) Nil else constr :: Nil
642
642
val prefix : Text =
643
- if (constr.symbol.owner.is(Module )) " "
643
+ if (constr.symbol.owner.is(Module )) " "
644
644
else if (vparamss.isEmpty || primaryConstrs.nonEmpty) tparamsTxt
645
645
else {
646
646
var modsText = modText(constr.mods, " " )
@@ -661,7 +661,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
661
661
params ::: rest
662
662
} else impl.body
663
663
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 " ) ~ " }"
665
667
666
668
prefix ~ (keywordText(" extends" ) provided (! ofNew && parents.nonEmpty)) ~~ parentsText ~~ bodyText
667
669
}
Original file line number Diff line number Diff line change 1
1
/** Decompiled from out/posTestFromTasty/pos/simpleCaseObject/foo/Foo.class */
2
2
package foo {
3
- case object Foo {
3
+ case object Foo {
4
4
override def hashCode(): Int = 1045991777
5
5
override def toString(): String = "Foo"
6
6
override def canEqual(that: Any): Boolean =
Original file line number Diff line number Diff line change 1
1
/** Decompiled from out/runTestFromTasty/run/puzzle/Test.class */
2
- object Test {
2
+ object Test {
3
3
def main(args: Array[String]): Unit =
4
4
{
5
5
println(if false then 5.0 else 53.0)
You can’t perform that action at this time.
0 commit comments