Project

General

Profile

Feature #14397

public, protected and private should return their arguments instead of self

Added by usa (Usaku NAKAMURA) over 2 years ago. Updated over 1 year ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:85079]

Description

Matsuda-san suggested me that public, protected and private should return their arguments instead of self,
to write such code:`

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 values of public, protected and private.
Matz, how do you think about this change?
The patch is attached.


Files

return_values_of_visibility_methods.diff (7.47 KB) return_values_of_visibility_methods.diff usa (Usaku NAKAMURA), 01/24/2018 09:25 PM

Related issues

Related to CommonRuby - Feature #11541: Let attr_accessor, _reader & _writer return symbols of the defined methodsOpenActions
Has duplicate Ruby master - Feature #14396: public, protected and private should return their arguments instead of selfRejectedmatz (Yukihiro Matsumoto)Actions

Also available in: Atom PDF