[ruby-core:93549] [Ruby master Bug#11425] super_method fails to find the super method when combined with Module#prepend

From: merch-redmine@...
Date: 2019-07-05 00:25:17 UTC
List: ruby-core #93549
Issue #11425 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Closed

This was fixed between Ruby 2.3 and 2.4:

```
$ ruby23 -e '
> class C; def a() end end
> module M def a() end end
> C.prepend M
> p C.instance_method(:a).super_method
> '
nil
$ ruby24 -e '
> class C; def a() end end
> module M def a() end end
> C.prepend M
> p C.instance_method(:a).super_method
> '
#<UnboundMethod: C#a>
```

----------------------------------------
Bug #11425: super_method fails to find the super method when combined with Module#prepend
https://bugs.ruby-lang.org/issues/11425#change-79114

* Author: matsuda (Akira Matsuda)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.3.0dev (2015-08-09 trunk 51513) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
`super_method` now fails to find the target method of `Module#prepend` maybe since commit:51501 https://github.com/ruby/ruby/commit/6b7c4df

~~~ruby
class C; def a() end end
module M def a() end end
C.prepend M
p C.instance_method(:a).super_method
~~~

~~~
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
#=> #<UnboundMethod: Object(C)#a>

ruby 2.3.0dev (2015-08-09 trunk 51513) [x86_64-darwin14]
#=> nil
~~~


---Files--------------------------------
bug11425.patch (935 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next