diff options
| author | nagachika <nagachika@ruby-lang.org> | 2022-09-03 15:05:32 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2022-09-03 15:05:32 +0900 |
| commit | 5473c1064d5e82d706b554f2fe5a5b41900f6b14 (patch) | |
| tree | ecf6a428a735a1956be187d5fd719154c18ff10a /include/ruby | |
| parent | 9b9704f9dc152c02b5baf370cf62923b07cb6072 (diff) | |
merge revision(s) 8212aab81a77a2a91fb7c1681b4968171193b48f,209631a45f9682dedf718f4b4a140efe7d21a6fc: [Backport #18435]
Make Object#method and Module#instance_method not skip ZSUPER methods
Based on https://github.com/jeremyevans/ruby/commit/c95e7e5329140f640b6497905485761f3336d967
Among other things, this fixes calling visibility methods (public?,
protected?, and private?) on them. It also fixes #owner to show the
class the zsuper method entry is defined in, instead of the original
class it references.
For some backwards compatibility, adjust #parameters and #source_location,
to show the parameters and source location of the method originally
defined. Also have the parameters and source location still be shown
by #inspect.
Clarify documentation of {Method,UnboundMethod}#owner.
Add tests based on the description of https://bugs.ruby-lang.org/issues/18435
and based on https://github.com/ruby/ruby/pull/5356#issuecomment-1005298809
Fixes [Bug #18435] [Bug #18729]
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
---
proc.c | 63 +++++++++++++++++++++++++++++++++++-------------
test/ruby/test_method.rb | 59 +++++++++++++++++++++++++++++++++++++++++----
2 files changed, 100 insertions(+), 22 deletions(-)
Consider resolved-through-zsuper methods equal for compatibility
* Fixes https://bugs.ruby-lang.org/issues/18751
---
proc.c | 65 +++++++++++-------------
spec/ruby/core/unboundmethod/equal_value_spec.rb | 37 ++++++++++++++
test/ruby/test_method.rb | 18 +++++++
3 files changed, 86 insertions(+), 34 deletions(-)
Diffstat (limited to 'include/ruby')
0 files changed, 0 insertions, 0 deletions
