Skip to content

Commit 932d396

Browse files
committed
Merge pull request #112 from dotty-staging/topic/loggable-transforms
Topic/loggable transforms
2 parents c8feb0c + cfa1ccf commit 932d396

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/dotty/tools/dotc/config/Printers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ object Printers {
2525
val hk = noPrinter
2626
val incremental = noPrinter
2727
val config = noPrinter
28+
val transforms = new Printer
2829
}

src/dotty/tools/dotc/transform/TreeTransform.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
package dotty.tools.dotc.transform
1+
package dotty.tools.dotc
2+
package transform
23

34
import dotty.tools.dotc.ast.tpd
45
import dotty.tools.dotc.core.Contexts.Context
@@ -7,6 +8,7 @@ import dotty.tools.dotc.core.Symbols.Symbol
78
import dotty.tools.dotc.ast.Trees._
89
import dotty.tools.dotc.core.Decorators._
910
import scala.annotation.tailrec
11+
import config.Printers.transforms
1012

1113
object TreeTransforms {
1214
import tpd._
@@ -1119,7 +1121,7 @@ object TreeTransforms {
11191121
case tree => tree
11201122
}
11211123

1122-
def transform(tree: Tree, info: TransformerInfo, cur: Int)(implicit ctx: Context): Tree = {
1124+
def transform(tree: Tree, info: TransformerInfo, cur: Int)(implicit ctx: Context): Tree = ctx.traceIndented(s"transforming ${tree.show} at ${ctx.phase}", transforms, show = true) {
11231125
tree match {
11241126
//split one big match into 2 smaller ones
11251127
case tree: NameTree => transformNamed(tree, info, cur)

tests/pos/overrides.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class A[T] {
2+
3+
def f(x: T)(y: T = x) = y
4+
5+
}
6+
7+
class B extends A[Int] {
8+
9+
def f(x: Int)(y: Int) = y
10+
11+
f(2)()
12+
13+
}

0 commit comments

Comments
 (0)