Skip to content

Topic/loggable transforms #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dotty/tools/dotc/config/Printers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ object Printers {
val hk = noPrinter
val incremental = noPrinter
val config = noPrinter
val transforms = new Printer
}
6 changes: 4 additions & 2 deletions src/dotty/tools/dotc/transform/TreeTransform.scala
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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._
Expand Down Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once #99 is merged, you could use i and save the .show ;-)

tree match {
//split one big match into 2 smaller ones
case tree: NameTree => transformNamed(tree, info, cur)
Expand Down
13 changes: 13 additions & 0 deletions tests/pos/overrides.scala
Original file line number Diff line number Diff line change
@@ -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)()

}