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 solvesthis by prepending the library name to the module attributes.
Perhaps typed_struct could do the same?
I'd be happy to do a PR.
The text was updated successfully, but these errors were encountered:
lasseebert commentedMay 27, 2020
•
edited
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.
The text was updated successfully, but these errors were encountered: