calling a 'class' method on an object's metaclass should invoke the class method of the object's class
Reported by Sam Aaron | June 22nd, 2008 @ 01:50 AM | in 1.0 preview
Try executing the attached file (created to aid my understanding of Ruby's object model). In Rubinius it fails at the following line:
puts "b_with_meta.metaclass.cheese: #{b_with_meta.metaclass.cheese}"
However, on all other versions of Ruby (MRI, JRuby, MacRuby, Ruby-1-9), the code executes completely and produces the following output:
A.cheese: edam
B.cheese: stilton
a.cheese: shropshire blue
b.cheese: cheddar
b_with_meta.cheese: cheshire
b_with_meta.metaclass.cheese: stilton
b_with_meta_meta.cheese: brie
b_with_meta_meta.metaclass.cheese: gouda
b_with_meta_meta.metaclass.metaclass.cheese: wensleydale
Comments and changes to this ticket
-
Ryan Davis June 23rd, 2008 @ 03:50 PM
- → Assigned user changed from to Wilson Bilkovich
-
Sam Aaron October 29th, 2008 @ 03:53 AM
- → Tag changed from to bug
This seems to be fixed with the new C++ VM.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
