Project

General

Profile

Actions

Bug #2537

closed

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

Added by bon (Nobuhide Nakabo) almost 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]
[ruby-dev:39931]

Description

=begin
クラスを継承した先で、ブロック内から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]#
=end


Files

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

Related issues 1 (0 open1 closed)

Has duplicate Ruby 1.8 - Bug #2600: block.callの中でsuperできないClosednobu (Nobuyoshi Nakada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0