c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Public or exported functions that depend on unexported types should be an error

Open joshring opened this issue 6 months ago • 1 comments

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

joshring avatar Jun 01 '25 01:06 joshring

Two solutions comes to mind:

  1. Disallow such public functions that use private types, and require that the types are visible.
  2. Implicitly make them visible.
  3. (1) but allow exported functions to make public types exported.

It's a convenience vs clarity problem.

lerno avatar Jun 21 '25 22:06 lerno