YAML.load is broken when loading structs with initialize method with arguments
------------------------------------------------------------------------------
Key: JRUBY-3856
URL: http://jira.codehaus.org/browse/JRUBY-3856
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.3.1
Environment: jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java
HotSpot(TM) Client VM 1.6.0_14) [i386-java]
Reporter: Jesús GS
Assignee: Thomas E Enebo
It fails when the class to load is subclass of *Struct*, it should be some
behaviour of struct implementation more than Yaml module, i guess...
{code:none}
$ jirb
>> class Good; def initialize(a); end; end
=> nil
>> class Bad < Struct.new(:whatever); def initialize(a); end; end
=> nil
>> YAML.load( Good.new(1).to_yaml )
=> #<Good:0x5878d2>
>> YAML.load( Bad.new(1).to_yaml )
ArgumentError: wrong # of arguments(0 for 1)
from (irb):5:in `new'
from (irb):5
{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