Actions
Bug #11687
closedMethod visibility changers works on frozen modules
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-11-14 trunk 52576) [x86_64-darwin15]
Description
Method visibility changers are working after freeze
.
Is this an intended behavior?
module Foo
CONSTANT = nil
def func; end
freeze
end
Foo.private_constant :CONSTANT #=> RuntimeError: can't modify frozen module
Foo.__send__ :private, :func #=> returned: Foo, expected: a RuntimeError as above
Foo.private_instance_methods #=> [:func]
Updated by nobu (Nobuyoshi Nakada) over 8 years ago
- Status changed from Open to Closed
Applied in changeset r52579.
vm_method.c: check if frozen [Fix GH-1096]
- vm_method.c (set_method_visibility): should fail if the receiver
is frozen. [ruby-core:71489] [Bug #11687]
Actions
Like0
Like0