Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error identification middleware calling into the wrong super #315

Merged

Conversation

KJTsanaktsidis
Copy link
Contributor

I hbad thought that because the body of call and call_super are identical, it would be OK to just alias them. However, that means they both call into the call super, and never the call_pipelined super, as it turns out, which is wrong.

irb(main):001* class Base
irb(main):002*   def hello_1 = puts "hello1"
irb(main):003*   def hello_2 = puts "hello2"
irb(main):004> end
=> :hello_2
irb(main):005* class Derived < Base
irb(main):006*   def hello_1
irb(main):007*     puts "about to hello"
irb(main):008*     super
irb(main):009*   end
irb(main):010*   alias hello_2 hello_1
irb(main):011> end
=> nil
irb(main):012> Derived.new.hello_1
about to hello
hello1
=> nil
irb(main):013> Derived.new.hello_2
about to hello
hello1
=> nil

I was surprised to learn this! I don't know what bug this is actually causing but I'm sure it can't be good.

I hbad thought that because the body of `call` and `call_super` are
identical, it would be OK to just alias them. However, that means they
both call into the `call` super, and never the `call_pipelined` super,
as it turns out, which is wrong.
@KJTsanaktsidis KJTsanaktsidis force-pushed the ktsanaktsidis/dont_alias_pipeline branch from 07688c0 to 2f10afa Compare January 23, 2024 06:28
@supercaracal supercaracal merged commit 0e12ee4 into redis-rb:master Jan 23, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants