Bad (inexistent) error location
Hello,
I'm adding ppx_deriving_yojson into a large project, and sadly at some point, it reports errors at line 1, which we guess is the default location.
It makes fixing the errors borderline impossible :(
Sorry about that. Would you have a repro case to test?
I'll look into this as I think it's just a matter of generating code with a sensible location. A good place to start would be to make the generated code point to the [@@deriving ...] attribute or the type declaration as is done in other derivers.
I think a typical example of when this bites is something like:
type t = M.t
[@@deriving yojson]
which generates code that relies on M.to_yojson being present. If it's not, the compiler will report the error with the location of the generated code.
I'll add a test case for this as well.