From: Jeremy Evans Date: 2020-12-03T15:04:44-08:00 Subject: [ruby-core:101233] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings On 12/03 05:44, Austin Ziegler wrote: > What does this mean? > > > Considering that you can alias a method to itself to avoid the warning, > and therefore do not need to remove the method first (which would cause a > race condition), I am dropping my request to add > `expected_redefined_method?(method_name)`. As shown by Urabe-san: ```ruby def foo end # This avoids the redefinition warning alias foo foo # This would normally result in a redefinition warning in verbose mode, # if not for the alias above. def foo end ``` > I have code that I???ve written to get around some rdoc silliness that does: > > # rdoc documentation for foo. > attr_writer :foo > undef :foo= > def foo=(x) #:nodoc: > # specialized foo assignment code > end > > If I didn???t do this, RDoc documents both the attribute and the `foo=` > method (or it did the last time I checked) even though all I want > documented is the attribute for readability. How would I make it so that I > don???t need to do `undef :foo=` here, as that has been one thing that has > failed this code (_hard_) with both type analyzers for Ruby. This seems to be an unrelated issue. I would avoid the attr_writer and the undef. If you just want RDoc to mark this as an attribute method instead of general method, then you may want to submit a pull request to rdoc to add markup syntax to be able to flag a regular method as an attribute method. Thanks, Jeremy Unsubscribe: