Created
August 23, 2016 06:48
-
-
Save harpocrates/f55b5725a515706bd9c55291aa917fa4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.language.experimental.macros | |
import scala.reflect.macros.blackbox.Context | |
object Macro | |
// inspect how scala has desugared your code | |
def traceSugar[T](t: T): T = macro impl | |
def impl(c: Context)(t: c.Tree): c.Tree = { println(t); t } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment