Closed antedeguemon closed 1 year ago
Note the above only works for primitive types - if a type has a union with another type, then it complicates things as we would need to resolve the type definition with recursion:
@type guest_role :: :guest
@type admin_role :: :admin | :owner
@type role :: admin_role() | guest_role()
That sounds like a very good idea. Thank you.
Hey! I gave some more thought to this idea and I think this check is out of Recode's scope.
A linter with autocorrection and a refactoring tool.
I am closing the issue but feel free to re-open it in case you think it fits. 😸
IMO it would be useful for large codebases if there was a task for fixing redundant type definitions. It doesn't need to actually resolve the type definitions, a superficial check would
An example of this issue in a codebase is the type
role
being defined inschemas/user.ex
Problem surges when another definition used its values - when it could reference
User.role()
: