Actions
Bug #3406
closedattr_accessor creates a private writer method
Description
=begin
(Also, there is a warning that may be incorrect.)
$ cat t.rb
module M
private
def attr_accessor(*args); super; end
end
class C
extend M
attr_accessor :x
end
C.new.x = 1
$ ruby19 -v t.rb
ruby 1.9.2dev (2010-05-31) [x86_64-linux]
t.rb:3: warning: private attribute?
t.rb:11:in <main>': private method
x=' called for #<C:0x000000012e5670> (NoMethodError)
=end
Actions
Like0
Like0Like0Like0Like0