# Static method on a C# class extending a generic class

**URL:** <https://www.ruby-forum.com/t/static-method-on-a-c-class-extending-a-generic-class/190821>\
**Category:** IronRuby\
**Created:** [June 28, 2010, 8:02pm UTC](https://www.ruby-forum.com/t/static-method-on-a-c-class-extending-a-generic-class/190821 "2010-06-28T20:02:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dzo](https://www.ruby-forum.com/u/dzo)\
**Post date:** [June 28, 2010, 8:02pm UTC](https://www.ruby-forum.com/t/static-method-on-a-c-class-extending-a-generic-class/190821/1 "2010-06-28T20:02:51Z")

</div>

Sorry, confusing subject, but just a quick question.

I wanted to make one of my C# classes generic, but I didn’t want to have  
to worry about rewriting code everywhere that class was used, so I  
created a default derived class that shared the same name that had my  
default generic type.

So something like this:

```
public class MyClass : MyClass<string> {
    public static string TestStringDerived = "World";
    public static string TestFuncDerived() {
        return "World";
    }
}
public class MyClass<T> {
    public static string TestString = "Hello";
    public static string TestFunc() {
        return "Hello";
    }
}

```

Then I found in IronRuby that everywhere I had used MyClass.TestFunc or  
MyClass.TestString no longer worked. In fact in the above example  
MyClass.TestFuncDerived and MyClass.TestStringDerived don’t work either.  
I have already found my solution. Simply by adding an empty generic  
parameter it will work. So, MyClass[].TestFunc or  
MyClass[].TestFuncDerived works.

So, my question (just because I am curious) is whether there is some  
deeper reason as to why IronRuby does not assume I want an empty generic  
parameter (MyClass[]) when I just give it MyClass.

Thanks!
