# Super(foo) doesn't work correctly when subclassing Ruby classes implemented in C#

**URL:** <https://www.ruby-forum.com/t/super-foo-doesnt-work-correctly-when-subclassing-ruby-classes-implemented-in-c/192374>\
**Category:** IronRuby\
**Created:** [July 29, 2010, 8:04am UTC](https://www.ruby-forum.com/t/super-foo-doesnt-work-correctly-when-subclassing-ruby-classes-implemented-in-c/192374 "2010-07-29T08:04:22Z")\
**Posts on this page:** 2\
**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:** [July 29, 2010, 8:04am UTC](https://www.ruby-forum.com/t/super-foo-doesnt-work-correctly-when-subclassing-ruby-classes-implemented-in-c/192374/1 "2010-07-29T08:04:22Z")

</div>

I’ve found an odd bug. I think this is Tomas’ territory, but I could be  
wrong. I’ve already opened an issue on codeplex (  
[http://ironruby.codeplex.com/workitem/4957](http://ironruby.codeplex.com/workitem/4957)), but I figured I’d mention  
it  
here to generate some discussion.

First, here’s a quick repro of the bug:

class File2 \< File  
def initialize  
super(“foobar.txt”)  
end  
end

File2.new

# TypeError: can’t convert String into Fixnum

What’s going on here? Well, it looks like IronRuby has arbitrarily  
picked a  
constructor overload to use when it finds a call to super. If I instead  
put  
“super(1)”, it would work just fine. This same problem seems to plague  
any  
RubyClass that was implemented in C# using the IronRuby library APIs.

Could someone give me a sanity check, please? You’ll notice that the  
code  
snippet above works just fine on MRI, so I don’t think I’ve lost my  
marbles  
just yet :).

-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:** [July 30, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/super-foo-doesnt-work-correctly-when-subclassing-ruby-classes-implemented-in-c/192374/2 "2010-07-30T16:40:51Z")

</div>

Tomas, have you had a chance to look at this? It looks like we can’t  
safely  
subclass anything in the standard library (or yaml) in IronRuby.

Just wanted to see if you could confirm. If so, I’d bump up the  
priority of  
the CodePlex ticket - this is a pretty big incompatibility with MRI.

Cheers,  
-Charles

On Thu, Jul 29, 2010 at 1:03 AM, Charles S. \<
