Skip to content

Commit 1160d2c

Browse files
committed
Do not print self types of module objects
1 parent f77ac08 commit 1160d2c

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
652652
val selfText = {
653653
val selfName = if (self.name == nme.WILDCARD) keywordStr("this") else self.name.toString
654654
(selfName ~ optText(self.tpt)(": " ~ _) ~ " =>").close
655-
} provided !self.isEmpty
655+
} provided (!self.isEmpty && !constr.symbol.owner.is(Module))
656656

657657
val body = if (ctx.settings.YtestPickler.value) {
658658
// Pickling/unpickling reorders the body members, so we need to homogenize

compiler/test/dotty/tools/dotc/FromTastyTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class FromTastyTests extends ParallelTesting {
6161
"eff-dependent.scala",
6262
),
6363
recompileBlacklist = Set(
64-
"puzzle"
6564
)
6665
)
6766
step1.checkCompile() // Compile all files to generate the class files with tasty

tests/pos/simpleCaseObject.decompiled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Decompiled from out/posTestFromTasty/pos/simpleCaseObject/foo/Foo.class */
22
package foo {
3-
case object Foo { this: foo.Foo.type =>
3+
case object Foo {
44
override def hashCode(): Int = 1045991777
55
override def toString(): String = "Foo"
66
override def canEqual(that: Any): Boolean =

tests/run/puzzle.decompiled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** Decompiled from out/runTestFromTasty/run/puzzle/Test.class */
2-
object Test { this: Test.type =>
2+
object Test {
33
def main(args: Array[String]): Unit =
44
{
55
println(if false then 5.0 else 53.0)

0 commit comments

Comments
 (0)