* [ruby-core:91649] [Ruby trunk Bug#15629] super_method fails on binded/unbinded/cloned methods
[not found] <redmine.issue-15629.20190301005719@ruby-lang.org>
@ 2019-03-01 0:57 ` s.wanabe
2019-10-02 22:24 ` [ruby-core:95192] [Ruby master " merch-redmine
1 sibling, 0 replies; 2+ messages in thread
From: s.wanabe @ 2019-03-01 0:57 UTC (permalink / raw)
To: ruby-core
Issue #15629 has been reported by wanabe (_ wanabe).
----------------------------------------
Bug #15629: super_method fails on binded/unbinded/cloned methods
https://bugs.ruby-lang.org/issues/15629
* Author: wanabe (_ wanabe)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
derived from #13973:
```
module A
def foo
end
end
module B
def foo
end
end
class C
include A
include B
end
c = C.new
m1 = c.method(:foo)
p m1.super_method # => #<Method: A#foo>
p m1.clone.super_method # => nil
p m1.unbind.super_method # => nil
m2 = C.instance_method(:foo)
p m2.super_method # => #<UnboundMethod: A#foo>
p m2.clone.super_method # => nil
p m2.bind(c).super_method # => nil
```
`super_method` of binded/unbinded/cloned method should be `super_method` of original method, shouldn't it?
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-core:95192] [Ruby master Bug#15629] super_method fails on binded/unbinded/cloned methods
[not found] <redmine.issue-15629.20190301005719@ruby-lang.org>
2019-03-01 0:57 ` [ruby-core:91649] [Ruby trunk Bug#15629] super_method fails on binded/unbinded/cloned methods s.wanabe
@ 2019-10-02 22:24 ` merch-redmine
1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2019-10-02 22:24 UTC (permalink / raw)
To: ruby-core
Issue #15629 has been updated by jeremyevans0 (Jeremy Evans).
File super_method-bind-unbind-clone-15629.patch added
This bug is due to the fact that bind/unbind/clone do not copy the `iclass` entry, and without an `iclass` entry, `super_method` returns `nil`. Attached is a patch that fixes this issue.
----------------------------------------
Bug #15629: super_method fails on binded/unbinded/cloned methods
https://bugs.ruby-lang.org/issues/15629#change-81866
* Author: wanabe (_ wanabe)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
derived from #13973:
```
module A
def foo
end
end
module B
def foo
end
end
class C
include A
include B
end
c = C.new
m1 = c.method(:foo)
p m1.super_method # => #<Method: A#foo>
p m1.clone.super_method # => nil
p m1.unbind.super_method # => nil
m2 = C.instance_method(:foo)
p m2.super_method # => #<UnboundMethod: A#foo>
p m2.clone.super_method # => nil
p m2.bind(c).super_method # => nil
```
`super_method` of binded/unbinded/cloned method should be `super_method` of original method, shouldn't it?
---Files--------------------------------
super_method-bind-unbind-clone-15629.patch (4.85 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-02 22:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <redmine.issue-15629.20190301005719@ruby-lang.org>
2019-03-01 0:57 ` [ruby-core:91649] [Ruby trunk Bug#15629] super_method fails on binded/unbinded/cloned methods s.wanabe
2019-10-02 22:24 ` [ruby-core:95192] [Ruby master " merch-redmine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).