scriptsharp icon indicating copy to clipboard operation
scriptsharp copied to clipboard

No code generation for generic methods

Open motmot80 opened this issue 14 years ago • 1 comments

First I must say that the product seems very mature and has surpassed all my expectations. Thanks for publishing... Hoping that MS will support your product as Google supports GWT. Integration in ASP.NET would by great!!

But... : D

In Channel 9 you talked about the generic support (without it I would not have even tried to use it).

Using generic lists works fine but using generic method does not:

        // Generates: myMethod: function JGR_MyClass$myMethod(myObj)
        public object MyMethod(object myObj)
        {
            return myObj;
        }

        // Nothing generated / no error
        public T MyGenericMethod<T>(T myObj)
        {
            return myObj;
        }

But the call to the generic method is generated

        MyGenericMethod<string>(string myObj);

I expected that Script# shows an error. Without an error the code integrity is hurt. IMHO there should be nothing special behind generic methods in JavaScript. They should look like a none generic method:

        myGenericMethod: function JGR_MyClass$myGenericMethod(myObj)

Thanks in advance and best regards, Thomas

motmot80 avatar Jan 06 '12 04:01 motmot80

I would like to see generic methods supported too - would save alot of casting!

Thanks

Donal

dmcweeney avatar Mar 07 '12 22:03 dmcweeney