Project

General

Profile

Actions

Bug #1018

closed

return in an eigenclass definition

Added by shugo (Shugo Maeda) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2dev (2010-01-14 trunk 26325) [i386-mingw32]
Backport:
[ruby-core:21379]

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

return_from_eclass.patch (1.07 KB) return_from_eclass.patch wanabe (_ wanabe), 01/15/2010 12:28 AM

Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #2776: can't return from lambda with outer blockRejectedmatz (Yukihiro Matsumoto)02/22/2010Actions
Related to Ruby master - Bug #3141: yield in an eigenclass definitionClosedmame (Yusuke Endoh)04/13/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0