Project

General

Profile

Actions

Bug #11532

closed

private_constant works after module is frozen

Added by kares (Karol Bucek) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[ruby-core:<unknown>]

Description

... and it probably should not allow for changing constant visibility since others such as const_set honour freeze

2.2.2 :001 > module M; C = '1'; D = '2'; private_constant :D; end
 => M 
2.2.2 :002 > M.constants
 => [:C] 
2.2.2 :003 > M.freeze
 => M 
2.2.2 :004 > M.private_constant :D
 => M 
2.2.2 :005 > M.private_constant :C
 => M 
2.2.2 :006 > M.constants
 => [] 
Actions

Also available in: Atom PDF

Like0
Like0