Project

General

Profile

Bug #11532

private_constant works after module is frozen

Added by kares (Karol Bucek) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
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
 => [] 

Associated revisions

Revision dfa9eb54
Added by nobu (Nobuyoshi Nakada) about 4 years ago

variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 51881
Added by nobu (Nobuyoshi Nakada) about 4 years ago

variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

Revision 51881
Added by nobu (Nobuyoshi Nakada) about 4 years ago

variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

Revision 51881
Added by nobu (Nobuyoshi Nakada) about 4 years ago

variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

Revision 51881
Added by nobu (Nobuyoshi Nakada) about 4 years ago

variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

Revision 51881
Added by nobu (Nobuyoshi Nakada) about 4 years ago

variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

History

#1

Updated by nobu (Nobuyoshi Nakada) about 4 years ago

  • Status changed from Open to Closed

Applied in changeset r51881.


variable.c: fail if frozen

  • variable.c (set_const_visibility): fail if the class/module is frozen. [ruby-core:70828] [Bug #11532]

Also available in: Atom PDF