Project

General

Profile

Actions

Bug #632

closed

StringIO has an odd alias implementation [?]

Added by rogerdpack (Roger Pack) about 16 years ago. Updated over 13 years ago.

Status:
Closed
ruby -v:
Backport:
[ruby-core:19282]

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


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #730: Infinite recursion on 'super' in dynamically generated modulesClosedko1 (Koichi Sasada)11/09/200812/24/2008Actions
Actions #1

Updated by ko1 (Koichi Sasada) about 16 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 16 years ago

  • Category set to core
  • Assignee changed from matz (Yukihiro Matsumoto) to ko1 (Koichi Sasada)
  • Target version set to 1.9.1 Release Candidate

=begin

=end

Actions #3

Updated by yugui (Yuki Sonoda) about 16 years ago

  • Due date set to 12/24/2008
  • Category changed from core to YARV

=begin

=end

Actions #4

Updated by wanabe (_ wanabe) almost 16 years ago

=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

Actions #5

Updated by ko1 (Koichi Sasada) almost 16 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r21084.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0