diff --git a/src/dotty/tools/dotc/config/Printers.scala b/src/dotty/tools/dotc/config/Printers.scala index d06eb2ece5fc..680dee7abfee 100644 --- a/src/dotty/tools/dotc/config/Printers.scala +++ b/src/dotty/tools/dotc/config/Printers.scala @@ -25,4 +25,5 @@ object Printers { val hk = noPrinter val incremental = noPrinter val config = noPrinter + val transforms = new Printer } \ No newline at end of file diff --git a/src/dotty/tools/dotc/transform/TreeTransform.scala b/src/dotty/tools/dotc/transform/TreeTransform.scala index 425410ae7ed6..d164ae6bd673 100644 --- a/src/dotty/tools/dotc/transform/TreeTransform.scala +++ b/src/dotty/tools/dotc/transform/TreeTransform.scala @@ -1,4 +1,5 @@ -package dotty.tools.dotc.transform +package dotty.tools.dotc +package transform import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.Context @@ -7,6 +8,7 @@ import dotty.tools.dotc.core.Symbols.Symbol import dotty.tools.dotc.ast.Trees._ import dotty.tools.dotc.core.Decorators._ import scala.annotation.tailrec +import config.Printers.transforms object TreeTransforms { import tpd._ @@ -1116,7 +1118,7 @@ object TreeTransforms { case tree => tree } - def transform(tree: Tree, info: TransformerInfo, cur: Int)(implicit ctx: Context): Tree = { + def transform(tree: Tree, info: TransformerInfo, cur: Int)(implicit ctx: Context): Tree = ctx.traceIndented(s"transforming ${tree.show} at ${ctx.phase}", transforms, show = true) { tree match { //split one big match into 2 smaller ones case tree: NameTree => transformNamed(tree, info, cur) diff --git a/tests/pos/overrides.scala b/tests/pos/overrides.scala new file mode 100644 index 000000000000..3d254ea70a28 --- /dev/null +++ b/tests/pos/overrides.scala @@ -0,0 +1,13 @@ +class A[T] { + + def f(x: T)(y: T = x) = y + +} + +class B extends A[Int] { + + def f(x: Int)(y: Int) = y + + f(2)() + +}