Ticket #201 (closed defect: wontfix)
rb_objc_define_kvo_setter does not handle the case where the user might override the regular Ruby writer method.
| Reported by: | eloy.de.enige@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description
In my opinion, the setter created by rb_objc_define_kvo_setter should check if the user might have overrided the regular Ruby writer method and call it.
Consider:
class Foo
attr_accessor :bar
def bar=(value)
@bar = 'bar'
# super # depending on the impl.
end
end
f = Foo.new
f.bar = "foo"
f.bar # => "bar"
f.setBar("foo")
f.bar # => "foo"
The user will expect the value to always be "bar" as defined in the #bar= impl.
Change History
Note: See
TracTickets for help on using
tickets.

