I am trying to use the macros with quoted DSL for generating a class like this —
val name = ???
'{
final class ${name} {
def foo: String = ...
def bar: Int = ...
}
}
The idea is to generate a class with a particular name
. If name
is of type String
then the scala compiler throws syntax error. Same is true for Expr
.
What should be the type of name? Expr doesn't work.