I have a macro annotation that I use to inject implicit type class to a companion method.
@MyMacro case class MyClass[T](a: String, b: Int, t: T)
Most of the time it work as expected, but it breaks when I use type constraint notation:
@MyMacro case class MyClass[T: TypeClass](a: String, b: Int, t: T)
// private[this] not allowed for case class parameters
This error was described on SO and reported as a bug.
Thing is: macros (v1) are no longer maintained, so I cannot expect that this will be fixed.
So what I wanted to know is: can I fix this myself within a macro? Is this change done to AST in a way that I could somehow undo it? I would like to try repairing it within a macro instead of forcing all users to rewrite their code to ...(implicit tc: TypeClass[T])
.