Project

General

Profile

Bug #7675

main.protected is not defined

Added by Shugo Maeda about 3 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Normal
ruby -v:
ruby 2.0.0dev (2013-01-07 trunk 38731) [i686-linux]
Backport:
2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
[ruby-core:51322]

Description

main (self at toplevel) has public and private, but doesn't have protected.

public
private
protected #=> NoMethodError

It looks a bit weird.

I guess it was forgotten to add main.protected when Module#protected was introduced
in Ruby 1.1b9_05.
main.protected seems not to be useful because it makes methods of Object protected, but
it might be good to have main.protected for consistency.

History

#1 [ruby-core:51324] Updated by Motohiro KOSAKI about 3 years ago

Target version: 2.0.0

2.0?

#2 [ruby-core:51325] Updated by Shugo Maeda about 3 years ago

kosaki (Motohiro KOSAKI) wrote:

Target version: 2.0.0

2.0?

I considered it a bug, but if Matz consider it a new feature, feel free to move it to next minor or to reject it simply.

#3 [ruby-core:51326] Updated by Yukihiro Matsumoto about 3 years ago

I am not positive to add it.
There's no reason to add protected except for consistency, since it behaves just like public.

Matz.

#4 [ruby-core:51327] Updated by Shugo Maeda about 3 years ago

  • Status changed from Assigned to Rejected

matz (Yukihiro Matsumoto) wrote:

I am not positive to add it.
There's no reason to add protected except for consistency, since it behaves just like public.

OK, so I close this ticket.

Also available in: Atom PDF