You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your module defines a record and it also defines a type for it, that type should not be exported/accessible from the outside.
Should be on by default?
YES
Reasoning
Since the record is defined within the module, nobody from outside the module should know how to build an instance of that record. That means that the type associated with the record should not be public.
It can be an opaque type, so that other modules can pass around record instances but not [de]construct them. Or it can just be not exported so no modules other than the current one have knowledge about the record.
No Exported Record Types
Brief Description
If your module defines a record and it also defines a type for it, that type should not be exported/accessible from the outside.
Should be on by default?
YES
Reasoning
Since the record is defined within the module, nobody from outside the module should know how to build an instance of that record. That means that the type associated with the record should not be public.
It can be an opaque type, so that other modules can pass around record instances but not [de]construct them. Or it can just be not exported so no modules other than the current one have knowledge about the record.
Examples
The text was updated successfully, but these errors were encountered: