Issue #14396 has been updated by usa (Usaku NAKAMURA).

Status changed from Assigned to Rejected

誤ってruby-devに投げてしまったのでこっちは閉じます。
[Feature #14397] を参照。

----------------------------------------
Feature #14396: public, protected and private should return their argumentsinstead of self
https://bugs.ruby-lang.org/issues/14396#change-69794

* Author: usa (Usaku NAKAMURA)
* Status: Rejected
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 2.6
----------------------------------------
Matsuda-san suggested me that `public`, `protected` and `private` should return their arguments instead of self,
to write such code:

```Ruby
require "finalist"
# see https://github.com/joker1007/finalist

class Foo
  extend Finalist

  final private def foo
  end
end
```

I believe that it's reasonable request, and also believe that there is no product code which uses the return value of `public`, `protected` and `private`.
Matz, how about this change?
The patch is attached.

---Files--------------------------------
return_values_of_visibility_methods.diff (7.47 KB)


-- 
https://bugs.ruby-lang.org/