I’m trying to build a small library to transform JSON data (e.g raw, string-based maps) into structs and such based on a module’s typespec (draft implementation can be found here: forma.ex · GitHub).
However, since I need to do a bit of parsing of the typespecs in order to accomplish this, I though I’d move it to compile time. But it seems I can’t access the typespec AST until the bytecode has been generated, which becomes a bit of a catch 22.
It looks like you are doing your generation from another module? If so then just require that other module and mix will compile it before yours is compiled.