Bug #2537

継承クラスにて、ブロック内にてsuperを呼ぶと、super called outside of method (NoMethodError)が発生する

Added by Nobuhide Nakabo about 2 years ago. Updated 9 months ago.

[ruby-dev:39931]
Status:Closed Start date:12/28/2009
Priority:Normal Due date:
Assignee:Nobuyoshi Nakada % Done:

100%

Category:-
Target version:-
ruby -v:ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]

Description

クラスを継承した先で、ブロック内からsuperを呼ぶと、super called outside of method (NoMethodError)が発生します。
ruby 1.8.7 (2009-06-12 patchlevel 174)では発生しません。
ruby 1.8.7 (2009-12-24 patchlevel 248)で確認しました。

添付のtest.rbで実行した結果

[root@localhost tmp]# ruby -v ; ruby /tmp/test.rb
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
"---- super class ----"
[root@localhost tmp]# ruby -v ; ruby /tmp/test.rb
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]
/tmp/test.rb:17: super called outside of method (NoMethodError)
        from /tmp/test.rb:3:in `call'
        from /tmp/test.rb:3:in `test'
        from /tmp/test.rb:16:in `aaa'
        from /tmp/test.rb:22
[root@localhost tmp]#

test.rb (213 Bytes) Nobuhide Nakabo, 12/28/2009 01:24 pm


Related issues

duplicated by Ruby 1.8 - Bug #2600: block.callの中でsuperできない Closed

Associated revisions

Revision 26535
Added by nobu about 2 years ago

* eval.c (proc_invoke): reverted r25975. [ruby-dev:39931] [ruby-dev:40059]

History

Updated by Yui NARUSE about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada
This is a bug from r25975 and nobu will fix this soon.

Updated by Nobuyoshi Nakada about 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
This issue was solved with changeset r26535.
Nobuhide, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

Also available in: Atom PDF