* [ruby-core:70678] [Ruby trunk - Bug #11512] [Open] DelegateClass.#public_{instance_}methods are returning difference values.
[not found] <redmine.issue-11512.20150907170033@ruby-lang.org>
@ 2015-09-07 17:00 ` kachick1
2019-05-24 5:02 ` [ruby-core:92812] [Ruby trunk Bug#11512] " merch-redmine
1 sibling, 0 replies; 2+ messages in thread
From: kachick1 @ 2015-09-07 17:00 UTC (permalink / raw)
To: ruby-core
Issue #11512 has been reported by Kenichi Kamiya.
----------------------------------------
Bug #11512: DelegateClass.#public_{instance_}methods are returning difference values.
https://bugs.ruby-lang.org/issues/11512
* Author: Kenichi Kamiya
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this intended behavior?
A patch is PR#926(https://github.com/ruby/ruby/pull/926)
~~~
require 'delegate'
class Parent
def parent_public; end
protected
def parent_protected; end
end
class Child < Parent
end
class DelegatorChild < DelegateClass(Parent)
end
class Parent
def parent_public_added; end
protected
def parent_protected_added; end
end
ignores = Object.public_instance_methods | Delegator.public_instance_methods
p(Child.public_instance_methods - ignores) #=> [:parent_public, :parent_public_added]
p(Child.new.public_methods - ignores) #=> [:parent_public, :parent_public_added]
p(DelegatorChild.public_instance_methods - ignores) #=> got: [:parent_public], expected: [:parent_public, :parent_public_added]
p(DelegatorChild.new(Parent.new).public_methods - ignores) #=> got: [:parent_public, :parent_public_added, :parent_protected]], expected: [:parent_public, :parent_public_added]
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-core:92812] [Ruby trunk Bug#11512] DelegateClass.#public_{instance_}methods are returning difference values.
[not found] <redmine.issue-11512.20150907170033@ruby-lang.org>
2015-09-07 17:00 ` [ruby-core:70678] [Ruby trunk - Bug #11512] [Open] DelegateClass.#public_{instance_}methods are returning difference values kachick1
@ 2019-05-24 5:02 ` merch-redmine
1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2019-05-24 5:02 UTC (permalink / raw)
To: ruby-core
Issue #11512 has been updated by jeremyevans0 (Jeremy Evans).
File fix-delegate-class-method-visibility.patch added
This appears to still be a bug. The patch needed a little manual help to apply, and the tests needed to be updated, but after those changes, all tests passed. Attached is an updated patch. I'll try to commit it next week unless I hear objections.
----------------------------------------
Bug #11512: DelegateClass.#public_{instance_}methods are returning difference values.
https://bugs.ruby-lang.org/issues/11512#change-78186
* Author: kachick (Kenichi Kamiya)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Is this intended behavior?
A patch is PR#926(https://github.com/ruby/ruby/pull/926)
~~~
require 'delegate'
class Parent
def parent_public; end
protected
def parent_protected; end
end
class Child < Parent
end
class DelegatorChild < DelegateClass(Parent)
end
class Parent
def parent_public_added; end
protected
def parent_protected_added; end
end
ignores = Object.public_instance_methods | Delegator.public_instance_methods
p(Child.public_instance_methods - ignores) #=> [:parent_public, :parent_public_added]
p(Child.new.public_methods - ignores) #=> [:parent_public, :parent_public_added]
p(DelegatorChild.public_instance_methods - ignores) #=> got: [:parent_public], expected: [:parent_public, :parent_public_added]
p(DelegatorChild.new(Parent.new).public_methods - ignores) #=> got: [:parent_public, :parent_public_added, :parent_protected]], expected: [:parent_public, :parent_public_added]
~~~
---Files--------------------------------
fix-delegate-class-method-visibility.patch (3.69 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread