[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
SXNzdWUgIzEyMTM0IGhhcyBiZWVuIHVwZGF0ZWQgYnkgTWFydGluIETDvHJzdC4KCgpUc3V5b3No
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74544] [Ruby trunk Bug#12216][Rejected] Class inherited Singleton method exclude argument from protected method accessing
From:
nobu@...
Date:
2016-03-25 02:17:34 UTC
List:
ruby-core #74544
Issue #12216 has been updated by Nobuyoshi Nakada.
Description updated
Status changed from Open to Rejected
Expected behavior.
In the `inherited` method, `self` and `klass` are `A` and `B` respectively, which are instances of `Class`.
Protected methods can be called from a same class instance.
----------------------------------------
Bug #12216: Class inherited Singleton method exclude argument from protected method accessing
https://bugs.ruby-lang.org/issues/12216#change-57668
* Author: Adam Luzsi
* Status: Rejected
* Priority: Normal
* Assignee:
* ruby -v: 1.8.7-p375 && 1.9 && 2.+
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Dear Ruby Lang developers.
I would like to ask about why the following code can work?
Or is it a valid scenario and "as expected" behavior to ignore public call on a protected method.
Thank you guys for the brilliant!
```ruby
class A
class << self
def inherited(klass)
p klass.protected_method_call
end
protected
def protected_method_call
self.to_s
end
end
end
class B < A
end
# output: "B"
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>