Actions
Bug #2253
closedshould Class.new(Class) raise TypeError?
Description
=begin
Class.new(Class) does not raise TypeError as reported in [ruby-dev:34114].
$ ruby-1_8 -ve 'Class.new(Class)'
ruby 1.8.8dev (2009-10-22 revision 25430) [i686-linux]
$ ruby-1_8 -ve 'class Foo < Class; end'
ruby 1.8.8dev (2009-10-22 revision 25430) [i686-linux]
-e:1: can't make subclass of Class (TypeError)
$ ruby-trunk -ve 'Class.new(Class)'
ruby 1.9.2dev (2009-10-12 trunk 25313) [i686-linux]
$ ruby-trunk -ve 'class Foo < Class; end'
ruby 1.9.2dev (2009-10-12 trunk 25313) [i686-linux]
-e:1:in `': can't make subclass of Class (TypeError)
JRuby also works same as MRI. awesome.¶
should it raise TypeError?
FYI, in [ruby-list:8341], Matz said that he tried to
allow subclassing of Class but he couldn't do it for
implementation reason.
=end
Actions
Like0
Like0Like0