Forum: Ruby-core [ruby-trunk - Bug #7732][Open] refinements: super() in define_method => stack level too deep (System

547616d5e4aaee90426e7051dd766a5a?d=identicon&s=25 sowcow (Alexander K.) (Guest)
on 2013-01-23 10:26
(Received via mailing list)
Issue #7732 has been reported by sowcow (Alexander K.).

----------------------------------------
Bug #7732: refinements: super() in define_method => stack level too deep
(SystemStackError)
https://bugs.ruby-lang.org/issues/7732

Author: sowcow (Alexander K.)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-12-01 trunk 38126)


class Any
end

module Bug
  refine Any do
    define_method :to_s do
      super()
    end
  end
end

using Bug
p Any.new.to_s # stack level too deep (SystemStackError)

# other example and workaround solution https://gist.github.com/4603064
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 shugo (Shugo Maeda) (Guest)
on 2013-01-23 14:43
(Received via mailing list)
Issue #7732 has been updated by shugo (Shugo Maeda).

Status changed from Open to Rejected
Assignee set to shugo (Shugo Maeda)

sowcow (Alexander Koynov) wrote:
> using Bug
> p Any.new.to_s # stack level too deep (SystemStackError)

Duplicate with #7643.
----------------------------------------
Bug #7732: refinements: super() in define_method => stack level too deep
(SystemStackError)
https://bugs.ruby-lang.org/issues/7732#change-35552

Author: sowcow (Alexander Koynov)
Status: Rejected
Priority: Normal
Assignee: shugo (Shugo Maeda)
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-12-01 trunk 38126)


class Any
end

module Bug
  refine Any do
    define_method :to_s do
      super()
    end
  end
end

using Bug
p Any.new.to_s # stack level too deep (SystemStackError)

# other example and workaround solution https://gist.github.com/4603064
This topic is locked and can not be replied to.