[#108771] [Ruby master Bug#18816] Ractor segfaulting MacOS 12.4 (aarch64 / M1 processor) — "brodock (Gabriel Mazetto)" <noreply@...>

Issue #18816 has been reported by brodock (Gabriel Mazetto).

8 messages 2022/06/05

[#108802] [Ruby master Feature#18821] Expose Pattern Matching interfaces in core classes — "baweaver (Brandon Weaver)" <noreply@...>

Issue #18821 has been reported by baweaver (Brandon Weaver).

9 messages 2022/06/08

[#108822] [Ruby master Feature#18822] Ruby lack a proper method to percent-encode strings for URIs (RFC 3986) — "byroot (Jean Boussier)" <noreply@...>

Issue #18822 has been reported by byroot (Jean Boussier).

18 messages 2022/06/09

[#108937] [Ruby master Bug#18832] Suspicious superclass mismatch — "fxn (Xavier Noria)" <noreply@...>

Issue #18832 has been reported by fxn (Xavier Noria).

16 messages 2022/06/15

[#108976] [Ruby master Misc#18836] DevMeeting-2022-07-21 — "mame (Yusuke Endoh)" <noreply@...>

Issue #18836 has been reported by mame (Yusuke Endoh).

12 messages 2022/06/17

[#109043] [Ruby master Bug#18876] OpenSSL is not available with `--with-openssl-dir` — "Gloomy_meng (Gloomy Meng)" <noreply@...>

Issue #18876 has been reported by Gloomy_meng (Gloomy Meng).

18 messages 2022/06/23

[#109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected — "qnighy (Masaki Hara)" <noreply@...>

Issue #18878 has been reported by qnighy (Masaki Hara).

9 messages 2022/06/26

[#109055] [Ruby master Bug#18881] IO#read_nonblock raises IOError when called following buffered character IO — "javanthropus (Jeremy Bopp)" <noreply@...>

Issue #18881 has been reported by javanthropus (Jeremy Bopp).

9 messages 2022/06/26

[#109063] [Ruby master Bug#18882] File.read cuts off a text file with special characters when reading it on MS Windows — magynhard <noreply@...>

Issue #18882 has been reported by magynhard (Matth辰us Johannes Beyrle).

15 messages 2022/06/27

[#109081] [Ruby master Feature#18885] Long lived fork advisory API (potential Copy on Write optimizations) — "byroot (Jean Boussier)" <noreply@...>

Issue #18885 has been reported by byroot (Jean Boussier).

23 messages 2022/06/28

[#109083] [Ruby master Bug#18886] Struct aref and aset don't trigger any tracepoints. — "ioquatix (Samuel Williams)" <noreply@...>

Issue #18886 has been reported by ioquatix (Samuel Williams).

8 messages 2022/06/29

[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>

Issue #18888 has been reported by shugo (Shugo Maeda).

16 messages 2022/06/30

[ruby-core:108966] [Ruby master Bug#17130] Method#super_method is broken for aliased methods

From: "Dan0042 (Daniel DeLorme)" <noreply@...>
Date: 2022-06-16 18:57:32 UTC
List: ruby-core #108966
Issue #17130 has been updated by Dan0042 (Daniel DeLorme).


It looks to me like super_method is still broken for aliased methods.

```
class A
  def foo; end
end
class B < A
  alias foo2 foo
end
p B.instance_method(:foo2).super_method #=> #<UnboundMethod: A#foo>
```

I believe that here `B.instance_method(:foo2).super_method` should be nil, as it was in ruby <= 2.5

I'm not sure if this is a different bug, or a side effect of the above patch.


----------------------------------------
Bug #17130: Method#super_method is broken for aliased methods
https://bugs.ruby-lang.org/issues/17130#change-98067

* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.8.0dev (2020-08-25T21:09:31Z master a84a2e872f) [x86_64-openbsd6.7]
* Backport: 2.5: UNKNOWN, 2.6: DONE, 2.7: DONE
----------------------------------------
Method#super_method currently does not work correctly for aliased methods.  Here's a simple example:

```ruby
class A
  def m1; p :A_m1 end
  def m2; p :A_m2 end
end
class B < A
  def m1; p :B_m1; super end
  alias m2 m1
end

B.new.m2
puts

m = B.new.method(:m2)
m.call

puts
m.super_method.call
```

Current Output:

```
:B_m1
:A_m1

:B_m1
:A_m1

:A_m2
```

You can see from this example that normal super lookup for B#m2 is A#m1, as B#m2 is an alias of B#m1 and super lookup follows the original method name, not the aliased name. However, the `super_method` call returns a Method instance for A#m2 instead of A#m1.

There is another issue with aliases and that is when the method being aliased is from another module or class.  In this case, super lookup needs to start at the super class of the defined class of the method being aliased.  See https://bugs.ruby-lang.org/issues/11189#note-3 for an example of that issue.

I have a fix that handles both of these cases that I'll submit shortly via a pull request.



-- 
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