I am writing a macro in Scala, but when I call it I get an error message saying “Double does not take parameters”. Clearly there is something wrong with how the macro builds the AST. So how can I see the expanded macro? Is there a way to call the macro implementation at runtime?
Share
Provide
-Ymacro-debug-liteor-Ymacro-debug-verboseoption to the compiler.Off the top of my head, detalization of printed ASTs is governed by
-Yshow-trees-compact,-Yshow-trees-stringified,-Xprint-types,-uniqidand-Yshow-symkinds. You can find other gems by runningscala -Xandscala -Y(or inspecting the sources of scala settings at https://github.com/scala/scala/blob/2.10.x/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala).Also, despite being essentially a macro, reification has its own tracing mechanism that can be configured by
-Yreify-copypasteand-Yreify-debug.