c3c
c3c copied to clipboard
Public or exported functions that depend on unexported types should be an error
feature request for:
ensuring public/exported functions with non standard type parameters or return types, have those non standard type parameters or return types also exported/public.
Without this check it may be possible to produce code that can't easily be used
Two solutions comes to mind:
- Disallow such public functions that use private types, and require that the types are visible.
- Implicitly make them visible.
- (1) but allow exported functions to make public types exported.
It's a convenience vs clarity problem.