I have an object
object Helper{
val fieldName = "fooBar
}
which provides the name for a field. And a case class
case class BarBaz(fieldOne:Int, fieldTwo:String)
But instead of fieldTwo
, I would like to refer to Helper.fieldname
for the parameter name of the case class.
How can this be accomplished in Scala? Maybe via a macro? Or is there a simpler possibility? I.e.
case class BarBaz(fieldOne:Int, Helper.fieldName:String)
would be the desired output, but that will not compile.