[#61822] Plan Developers Meeting Japan April 2014 — Zachary Scott <e@...>

I would like to request developers meeting around April 17 or 18 in this mo=

14 messages 2014/04/03
[#61825] Re: Plan Developers Meeting Japan April 2014 — Urabe Shyouhei <shyouhei@...> 2014/04/03

It's good if we have a meeting then.

[#61826] Re: Plan Developers Meeting Japan April 2014 — Zachary Scott <e@...> 2014/04/03

Regarding openssl issues, I=E2=80=99ve discussed possible meeting time with=

[#61833] Re: Plan Developers Meeting Japan April 2014 — Martin Bo煬et <martin.bosslet@...> 2014/04/03

Hi,

[ruby-core:62156] [ruby-trunk - Bug #9626] [Rejected] alias, prepend and super cause unexpected SystemStackError

From: nobu@...
Date: 2014-04-25 06:23:27 UTC
List: ruby-core #62156
Issue #9626 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Rejected

It differs from #7842, since you overwrites `C#foo` itself.
`C#orig_foo` is an alias of `M#foo`, but not of the former `C#foo`.

----------------------------------------
Bug #9626: alias, prepend and super cause unexpected SystemStackError
https://bugs.ruby-lang.org/issues/9626#change-46311

* Author: Kohei Suzuki
* Status: Rejected
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
```ruby
module M
  def foo
    super
  end
end

class C
  def foo
    'C#foo'
  end

  prepend M
  alias_method :orig_foo, :foo
  def foo
    orig_foo
  end
end

C.new.foo
```

I expect: `M#foo` -> `C#foo` -> `C#orig_foo` and get `'C#foo'`
Actual: `M#foo` -> `C#foo` -> `M#foo` -> ... and get `stack level too deep (SystemStackError)`
If I swap the order of `alias_method` and `prepend`, it works as I expect.

I think it's closely related to #7842.



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

In This Thread

Prev Next