ejpcmac/typed_struct

Non-clashing module attributes

lasseebert opened this issue · 3 comments

I just got hit by the auto generated module attributes (@fields, @types and @keys_to_enforce).

I was changing an existing defstruct to use TypedStruct, but I already had a module attribute called @types. It took me a while to figure out what went wrong :)

ExUnit and Ecto both solves this by prepending the library name to the module attributes.

Perhaps typed_struct could do the same?

I'd be happy to do a PR.

I’m working on #14 right now, I’ll solve this one right after.

Thank you for your reports by the way!

Awesome. Thanks for the quick response and fix 😊