undefined methods are not preserved when a module/class is dup'ed.
------------------------------------------------------------------

                 Key: JRUBY-948
                 URL: http://jira.codehaus.org/browse/JRUBY-948
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
            Reporter: Bill Dortch


undefined methods (or more accurately, their undefined-ness) are not preserved 
when a module/class is dup'ed.  Applies to both class/module methods and 
instance methods.

MRI:
{noformat}
>> class A
>> undef_method :id
>> (class<<self;self;end).send(:undef_method,:id)
>> end
=> #<Class:A>
>> A.id
NoMethodError: undefined method `id' for A:Class
        from (irb):5
>> A.new.id
NoMethodError: undefined method `id' for #<A:0x2c17fe4>
        from (irb):6
>> Adup = A.dup
=> Adup
>> Adup.id
NoMethodError: undefined method `id' for Adup:Class
        from (irb):8
>> Adup.new.id
NoMethodError: undefined method `id' for #<Adup:0x2c1445c>
        from (irb):9
{noformat}

JRuby:
{noformat}
>> class A
>> undef_method :id
>> (class<<self;self;end).send(:undef_method,:id)
>> end
=> #<Class:A>
>> A.id
NoMethodError: undefined or inaccessible method `id' for A:Class
        from (irb):1:in `method_missing'
        from (irb):1:in `binding'
>> A.new.id
NoMethodError: undefined or inaccessible method `id' for #<A:0x163956>
        from (irb):1:in `method_missing'
        from (irb):1:in `binding'
>> Adup = A.dup
=> Adup
>> Adup.id
(irb):1 warning: Object#id will be deprecated; use Object#object_id
=> 6
>> Adup.new.id
(irb):1 warning: Object#id will be deprecated; use Object#object_id
=> 8
{noformat}



-- 
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

Reply via email to