Actions
Bug #1983
closedStruct doesn't define instance methods for valid method names
Description
=begin
foo = Struct.new(:foo?, :foo!).new(true, true)
=> #<struct :foo?=true, :foo!=true>
foo.foo?
NoMethodError: undefined methodfoo?' for #<struct :foo?=true, :foo!=true> from (irb):3 from /usr/local/bin/irb19:12:in
'
foo.foo!
NoMethodError: undefined methodfoo!' for #<struct :foo?=true, :foo!=true> from (irb):4 from /usr/local/bin/irb19:12:in
'
foo[:foo?]
=> true
foo[:foo!]
=> true
I think this is because foo?= and foo!= are not valid setter methods.
By why not generate the reader and skip the setter, then?
=end
Actions
Like0
Like0Like0Like0Like0Like0