Project

General

Profile

Feature #14396

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

Added by usa (Usaku NAKAMURA) 3 months ago. Updated 3 months ago.

Status:
Rejected
Priority:
Normal
Target version:
[ruby-dev:50428]

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

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

Related issues

Is duplicate of Ruby trunk - Feature #14397: public, protected and private should return their arguments instead of selfAssigned

History

#1 [ruby-dev:50429] Updated by usa (Usaku NAKAMURA) 3 months ago

  • Status changed from Assigned to Rejected

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

#2 Updated by usa (Usaku NAKAMURA) 3 months ago

  • Is duplicate of Feature #14397: public, protected and private should return their arguments instead of self added

Also available in: Atom PDF