Macros: enriching types with annotations

I’d like to write a macro which calls uPickle’s macroRW[T], but first enriches some fields of T with @upickle.implicits.key annotation. Is it possible to create a new type T2 by updating the definition of T? Or any other way to create/update type definitions in compile time using macros?

Update: I found this example. The Refinement API looks promising, I’ll try it out.