Bug #1018
closedreturn in an eigenclass definition
Description
=begin
Hi,
return in an eigenclass definition causes compile error on Ruby 1.9.
$ cat /tmp/t.rb
class Object
def eigenclass
class <<self
return self
end
end
end
p Object.eigenclass
$ ruby-trunk -v /tmp/t.rb
ruby 1.9.0 (2008-11-25 revision 20352) [i686-linux]
/tmp/t.rb:4: Invalid return
/tmp/t.rb: compile error (SyntaxError)
$ ruby-1_8 -v /tmp/t.rb
ruby 1.8.7 (2009-01-14 revision 21505) [i686-linux]
#Class:Object
It's a bug, isn't it?
FYI, It seems that the program execution is terminated on JRuby.
$ jruby -v /tmp/t.rb
jruby 1.1.6 (ruby 1.8.6 patchlevel 114) (2008-12-17 rev 8388) [i386-java]
$
Shugo
=end
Files
Updated by wanabe (_ wanabe) almost 15 years ago
- File return_from_eclass.patch return_from_eclass.patch added
- ruby -v set to ruby 1.9.2dev (2010-01-14 trunk 26325) [i386-mingw32]
=begin
When TAG_RETURN is thrown, how about updating lfp after pass ISEQ_TYPE_CLASS?
=end
Updated by mame (Yusuke Endoh) over 14 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r27714.
Shugo, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end