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
{{ message }}
Repository navigation
CAtomicFixnum should probably be a private constant #981
Otherwise we get misleading suggestions from did-you-mean in case concurrent/atomic/atomic_fixnum is not required but the extension is loaded like:
NameError:
uninitialized constant Concurrent::AtomicFixnum
counter = AtomicFixnum.new
^^^^^^^^^^^^
Did you mean? Concurrent::CAtomicFixnum
# ./spec/concurrent/atomic/cyclic_barrier_spec.rb:106:in `block (4 levels) in <module:Concurrent>'
Note that even if it's private, did-you-mean is still kind of misleading:
NameError:
uninitialized constant Concurrent::AtomicFixnum
counter = AtomicFixnum.new
^^^^^^^^^^^^
Did you mean? Concurrent::AtomicReference
# ./spec/concurrent/atomic/cyclic_barrier_spec.rb:191:in `block (5 levels) in <module:Concurrent>'
And there are various specs checking defined? Concurrent::CAtomicFixnum and even a benchmark referencing Concurrent::CAtomicFixnum, so it's not so easy to make it private unfortunately.
Given #986, it seems important to communicate very clearly which classes are internal, e.g., using private_constant.
Apparently "a class is only public if present in the documentation/README" is not clear enough.
Activity
eregon commentedon Jan 23, 2023
Given #986, it seems important to communicate very clearly which classes are internal, e.g., using
private_constant.Apparently "a class is only public if present in the documentation/README" is not clear enough.