Skip to content

Commit b08eff1

Browse files
committed
wip
1 parent 6d625fd commit b08eff1

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class DecompilerPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
5050
}
5151

5252
override protected def toTextTemplate(impl: Template, ofNew: Boolean = false): Text = {
53-
val impl1 = impl.copy(parents = impl.parents.filterNot(_.symbol.maybeOwner == defn.ObjectClass))
53+
def filter(sym: Symbol): Boolean = {
54+
sym.maybeOwner == defn.ObjectClass ||
55+
(sym == defn.ProductClass && impl.symbol.owner.is(Case))
56+
}
57+
val impl1 = impl.copy(parents = impl.parents.filterNot(p => filter(p.symbol)))
5458
super.toTextTemplate(impl1, ofNew)
5559
}
5660

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
628628
val tparamsTxt = withEnclosingDef(constr) { tparamsText(tparams) }
629629
val primaryConstrs = if (constr.rhs.isEmpty) Nil else constr :: Nil
630630
val prefix: Text =
631-
if (vparamss.isEmpty || primaryConstrs.nonEmpty) tparamsTxt
631+
if (constr.symbol.owner.is(Module)) " "
632+
else if (vparamss.isEmpty || primaryConstrs.nonEmpty) tparamsTxt
632633
else {
633634
var modsText = modText(constr.mods, "")
634635
if (!modsText.isEmpty) modsText = " " ~ modsText

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FromTastyTests extends ParallelTesting {
2626
// > dotc -Ythrough-tasty -Ycheck:all <source>
2727

2828
implicit val testGroup: TestGroup = TestGroup("posTestFromTasty")
29-
val (step1, step2, step3, step4) = compileTastyInDir("tests/pos2", defaultOptions,
29+
val (step1, step2, step3, step4) = compileTastyInDir("tests/pos", defaultOptions,
3030
blacklist = Set(
3131
"macro-deprecate-dont-touch-backquotedidents.scala",
3232
"t247.scala",

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
12881288
val generateClassFiles = compileFilesInDir(f, flags0, blacklist)
12891289

12901290
val decompilationDir = outDir + sourceDir.getName + "_decompiled"
1291+
new JFile(decompilationDir).mkdirs()
12911292
val recompileDecompiled = compileFilesInDir(decompilationDir, flags0, blacklist)
12921293

12931294
(

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() extends _root_.scala.Product { this: foo.Foo.type =>
3+
case object Foo { this: foo.Foo.type =>
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 { this: Test.type =>
33
def main(args: Array[String]): Unit =
44
{
55
println(if false then 5.0 else 53.0)

0 commit comments

Comments
 (0)