Bug #632
closed
StringIO has an odd alias implementation [?]
Added by rogerdpack (Roger Pack) almost 16 years ago.
Updated over 13 years ago.
Description
=begin
Here's my situation:
require 'stringio'
class C < StringIO
alias :old_init :initialize
def initialize
old_init
end
end
C.new # fails 1.9, succeeds 1.8.6
normal classes:
class A
def initialize
print 'A init'
end
end
class B < A
alias :old_init :initialize
def initialize
old_init
end
end
B.new # succeeds 1.9, 1.8
Thanks for your help! I know I'm annoying with this.
=end
- Assignee set to matz (Yukihiro Matsumoto)
- Category set to core
- Assignee changed from matz (Yukihiro Matsumoto) to ko1 (Koichi Sasada)
- Target version set to 1.9.1 Release Candidate
- Due date set to 12/24/2008
- Category changed from core to YARV
=begin
I guess the behavior is by this flow:
- C#initialize
-> C#old_init ( == StringIO#initialize )
-> strio_initialize()
-> rb_call_super()
-> Object#old_init
-> NoMethodError
1.8 avoids the problem because ruby_frame->orig_func can differ from ruby_frame->last_func,
so Object#old_init is not called but Object#initialize is.
=end
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r21084.
=end
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0