# Can't subclass IronRuby libraries ("super" doesn't resolve correctly)

**URL:** <https://www.ruby-forum.com/t/cant-subclass-ironruby-libraries-super-doesnt-resolve-correctly/192516>\
**Category:** IronRuby\
**Created:** [August 1, 2010, 12:45am UTC](https://www.ruby-forum.com/t/cant-subclass-ironruby-libraries-super-doesnt-resolve-correctly/192516 "2010-08-01T00:45:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valdar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b5a626/32.png) [@valdar](https://www.ruby-forum.com/u/valdar)\
**Post date:** [August 1, 2010, 12:45am UTC](https://www.ruby-forum.com/t/cant-subclass-ironruby-libraries-super-doesnt-resolve-correctly/192516/1 "2010-08-01T00:45:57Z")

</div>

I could use some help with Issue #4957  
([http://ironruby.codeplex.com/workitem/4957](http://ironruby.codeplex.com/workitem/4957)).

Does anyone know where super class ctors are resolved? I haven’t been  
able to spot where they are resolved in the code.

-Charles

---

<div class="post-metadata">

**Author:** ![valdar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b5a626/32.png) [@valdar](https://www.ruby-forum.com/u/valdar)\
**Post date:** [August 1, 2010, 7:28am UTC](https://www.ruby-forum.com/t/cant-subclass-ironruby-libraries-super-doesnt-resolve-correctly/192516/2 "2010-08-01T07:28:38Z")

</div>

Place breakpoint in file SuperCallAction.cs after the call to

method = targetClass.ResolveSuperMethodNoLock(currentMethodName,  
currentDeclaringModule).InvalidateSitesOnOverride().Info;

this finds the method. You can see that it is a RubyLibraryMethodInfo  
(i.e. a Ruby method defined in C# library) and has two overloads  
(MethodBases property)  
{IronRuby.Builtins.RubyIO Reinitialize(IronRuby.Builtins.RubyIO, Int32,  
IronRuby.Builtins.MutableString)}  
{IronRuby.Builtins.RubyIO Reinitialize(IronRuby.Builtins.RubyIO, Int32,  
Int32)}

This method is defined in IOOps and expects the first argument to be a  
file descriptor.  
If we look at File’s private instance methods in MRI we see:

irb(main):004:0\> File.private\_instance\_methods(false).sort  
=\> [“initialize”]

While in IronRuby we get a different result:

> > > File.private\_instance\_methods(false).sort  
> > > =\> [“blockdev?”, “chardev?”, “directory?”, “executable?”,  
> > > “executable\_real?”, “exist?”, “exists?”, “file?”, “grpowned?”,  
> > > “identical?”, “owned?”, “pipe?”, “readable?”, “readable\_real?”,  
> > > “setgid?”, “setuid?”, “size”, “size?”, “socket?”, “stic  
> > > ky?”, “symlink?”, “writable?”, “writable\_real?”, “zero?”]

This means there are two bugs:

1. initialize is missing from File
2. bunch of private methods shouldn’t be there

Have a fix almost ready.

Tomas

---

<div class="post-metadata">

**Author:** ![valdar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b5a626/32.png) [@valdar](https://www.ruby-forum.com/u/valdar)\
**Post date:** [August 1, 2010, 7:49pm UTC](https://www.ruby-forum.com/t/cant-subclass-ironruby-libraries-super-doesnt-resolve-correctly/192516/3 "2010-08-01T19:49:36Z")

</div>

Awesome - I just saw that this was marked as fixed on codeplex.

Thanks for taking the time to walk me through debugging this - I’m  
going to try it out a little later today. I would have tried it out  
yesterday, but it was bed time on my side of the planet 🙂 (12:10 AM,  
CDT).

Btw, sorry for spamming the mailing list - I kept getting bounce back  
notifications, despite the fact that each email I sent to the ML shows  
up on rubyforge (perhaps because of html formatting?), and I presume  
everyone received an email too. Arg…

> > > > Your message
> > > > 
> > > > To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > > > Subject: [Ironruby-core] Can’t subclass IronRuby libraries (“super”  
> > > > doesn’tresolve correctly)  
> > > > Sent: Sat, 31 Jul 2010 15:34:00 -0700
> > > > 
> > > > did not reach the following recipient(s):

-Charles

On Sun, Aug 1, 2010 at 12:10 AM, Tomas M.
