struct and its use of metaclasses is not quite right (for inspect and ==)
-------------------------------------------------------------------------
Key: JRUBY-866
URL: http://jira.codehaus.org/browse/JRUBY-866
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 0.9.8
Reporter: Thomas E Enebo
Assignee: Thomas E Enebo
Fix For: JRuby 0.9.9
Using metaclass instead of "real" class ends up making some structs not appear
to be equivalent and also when inspected they are printing out meta class
instead of real class.
{code}
MyStruct = Struct.new("MyStruct", :a, :b)
class MySubStruct < MyStruct
def initialize(v, *args) super(*args); @v = v; end
end
b = MySubStruct.new(1, 2)
p b
b.instance_eval {"EH"}
p b
c = MySubStruct.new(1, 2)
class << b
def foo
end
end
p b == c
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email