I have repetitive blocks of code I want to copy, like old C-style macros. I'm trying quasiquotes:
import scala.language.experimental.macros
object CodeBlock {
val quasi = q"""def foo() = {"bar"}"""
}
case class A() {
// ??? want quasi here
}
case class B() {
// ??? want quasi here
}
class Foo { def bar = macro myMacroGenBody }