I'm trying to create a value on a companion object based on the fields of a case class.
I'd like to do something like this:
case class A(
val a: Int,
val b: String
) extends MyTypeMacro
I'd like for this to add to add a value to its companion object...
object A {
//Generate...
val c: B = //Code value derived from case class fields...
}
Because companion objects and classes have access to each other, shouldn't I be able to accomplish this by accessing the companion object from within the case class type macro?
Also... I'd like to add 'val c' whether object A is defined or not.