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

Posted by 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
Posted by 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.